Skip to content
Snippets Groups Projects
Commit 68f6b5d7 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

attribute-defined-outside-init prohibited

parent f833da5e
No related branches found
No related tags found
1 merge request!354Additional pylint checks
......@@ -9,7 +9,6 @@ disable=
R0903, # too-few-public-methods
R0902, # too-many-instance-attributes
R0913, # too-many-arguments
W0201, # attribute-defined-outside-init
C0411, # wrong-import-order
C0103, # invalid-name
R0914, # too-many-locals
......
......@@ -30,6 +30,8 @@ class OfficeAvailability:
"""
def __init__(self, name, start=None, end=None, office_start='8:00', office_end='18:00', minimum_slot='1T'):
self.business_hours = None
today_midnight = get_today_midnight_date()
tomorrow_midnight = today_midnight + datetime.timedelta(days=1)
......
......@@ -51,6 +51,7 @@ class RedcapVisit:
virus_collection_date = None
iga_status = None
igg_status = None
virus_inconclusive = None
def different_string(string1, string2):
......
......@@ -25,9 +25,7 @@ class TestApi(TestCase):
response = self.client.get(reverse('web.api.appointment_types'))
self.assertEqual(response.status_code, 200)
self.appointment_type = create_appointment_type()
self.appointment_type.code = type_name
self.appointment_type.save()
create_appointment_type(code=type_name)
response = self.client.get(reverse('web.api.appointment_types'))
appointment_types = json.loads(response.content)['appointment_types']
......
......@@ -11,33 +11,34 @@ from web.tests.functions import create_user
class TestLoginView(TestCase):
def test_login(self):
self.client = Client()
client = Client()
user = create_user()
password = 'top_secret'
username = user.username
login_url = reverse(settings.LOGIN_URL)
self.assertFalse(django_auth.get_user(self.client).is_authenticated)
self.assertFalse(django_auth.get_user(client).is_authenticated)
form_data = {'auth-username': username, 'auth-password': password, 'login_view-current_step': 'auth'}
response = self.client.post(login_url, data=form_data, follow=True)
response = client.post(login_url, data=form_data, follow=True)
self.assertEqual(200, response.status_code)
self.assertTrue(django_auth.get_user(self.client).is_authenticated)
self.assertTrue(django_auth.get_user(client).is_authenticated)
worker = Worker.get_by_user(user)
self.assertIsNotNone(worker)
worker.last_name = 'Grouès'
worker.save()
response = self.client.post(login_url, data=form_data, follow=True)
response = client.post(login_url, data=form_data, follow=True)
self.assertEqual(200, response.status_code)
def test_login_failed(self):
self.client = Client()
client = Client()
user = create_user()
username = user.username
login_url = reverse(settings.LOGIN_URL)
response = self.client.post(login_url, data={'auth-username': username, 'auth-password': 'wrong-password',
'login_view-current_step': 'auth'}, follow=False)
response = client.post(login_url, data={'auth-username': username, 'auth-password': 'wrong-password',
'login_view-current_step': 'auth'}, follow=False)
self.assertContains(response, 'Please enter a correct')
self.assertContains(response, 'and password.')
self.assertFalse(django_auth.get_user(self.client).is_authenticated)
self.assertFalse(django_auth.get_user(client).is_authenticated)
def test_logout(self):
self.test_login()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment