From f643458708452ae7387efda6509bc049a0f01b77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 02:31:07 +0000 Subject: [PATCH 1/5] Bump pillow from 9.3.0 to 10.2.0 Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.3.0 to 10.2.0. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst) - [Commits](https://github.com/python-pillow/Pillow/compare/9.3.0...10.2.0) --- updated-dependencies: - dependency-name: pillow dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e09e3f8..e301d7c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -59,7 +59,7 @@ opencv-python-headless==4.5.2.54 zbar-py==1.0.4 drf-spectacular==0.20.2 beautifulsoup4==4.10.0 -Pillow==9.3.0 +Pillow==10.2.0 django-storages==1.12.3 boto3==1.20.24 django-celery-results==2.4.0 From 0ab6dfc1f5041e30eb53225f206415228d974593 Mon Sep 17 00:00:00 2001 From: Erik Harding Date: Thu, 25 Jan 2024 11:30:04 +0200 Subject: [PATCH 2/5] Update python test version --- .github/workflows/qa_build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qa_build.yaml b/.github/workflows/qa_build.yaml index 83487c3..67f2ea8 100755 --- a/.github/workflows/qa_build.yaml +++ b/.github/workflows/qa_build.yaml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.7.15 + python-version: 3.9 - name: Install dependencies run: | sudo apt-get update && sudo apt-get install -y gdal-bin From 32b6db96a05d9fbc21cd9f1b3ca7d1400b3fb678 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:55:37 +0000 Subject: [PATCH 3/5] Bump pillow from 9.3.0 to 10.2.0 Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.3.0 to 10.2.0. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst) - [Commits](https://github.com/python-pillow/Pillow/compare/9.3.0...10.2.0) --- updated-dependencies: - dependency-name: pillow dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 28191de..5ce6989 100644 --- a/requirements.txt +++ b/requirements.txt @@ -59,7 +59,7 @@ opencv-python-headless==4.5.2.54 zbar-py==1.0.4 drf-spectacular==0.20.2 beautifulsoup4==4.10.0 -Pillow==9.3.0 +Pillow==10.2.0 django-storages==1.12.3 boto3==1.20.24 django-celery-results==2.4.0 From 382ad940d7c0563dd8e226f5e74f877959bfb914 Mon Sep 17 00:00:00 2001 From: Erik Harding Date: Mon, 29 Jan 2024 15:15:11 +0200 Subject: [PATCH 4/5] upgrade psycopg2==2.9.9 --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 5ce6989..6a20741 100644 --- a/requirements.txt +++ b/requirements.txt @@ -35,7 +35,7 @@ pathspec==0.8.0 pathtools==0.1.2 phonenumbers==8.12.6 prometheus-client==0.8.0 -psycopg2==2.8.5 +psycopg2==2.9.9 pycodestyle==2.6.0 pycountry==20.7.3 pyflakes==2.2.0 diff --git a/setup.py b/setup.py index 23d1761..2035930 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ requirements = [ "django-environ==0.4.5", - "psycopg2==2.8.5", + "psycopg2==2.9.9", "requests==2.31.0", "rapidpro-python==2.6.1", "django-import-export==2.5.0", From 11ae726547858cce67de85010dee8cf1e13dbae6 Mon Sep 17 00:00:00 2001 From: Erik Harding Date: Mon, 29 Jan 2024 15:25:09 +0200 Subject: [PATCH 5/5] Update dev requirements --- clinicfinder/serializers.py | 2 +- clinicfinder/tests/test_views.py | 4 +-- clinicfinder/urls.py | 6 +++- .../migrations/0002_auto_20200721_1306.py | 5 +++- contacts/models.py | 15 ++++++++-- contacts/tasks.py | 4 ++- contacts/tests.py | 6 ++-- covid_cases/tests.py | 4 ++- healthcheck/utils.py | 8 +++-- requirements-dev.txt | 6 ++-- selfswab/tests/test_utils.py | 6 ++-- selfswab/tests/test_views.py | 30 +++++++++++++++---- selfswab/utils.py | 4 ++- .../migrations/0006_auto_20200908_1655.py | 4 ++- .../0011_remove_tbcheck_group_arm.py | 5 +++- tbconnect/tasks.py | 6 ++-- tbconnect/tests/test_views.py | 25 +++++++++++----- .../migrations/0003_auto_20200814_1416.py | 9 ++++-- userprofile/tests/test_models.py | 8 +++-- userprofile/views.py | 4 +-- users/admin.py | 5 +++- users/migrations/0001_initial.py | 9 ++++-- users/migrations/0003_auto_20200716_1408.py | 15 ++++++++-- users/migrations/0004_remove_user_email.py | 5 +++- users/tests.py | 6 ++-- 25 files changed, 148 insertions(+), 53 deletions(-) diff --git a/clinicfinder/serializers.py b/clinicfinder/serializers.py index 3ff5fca..66c6b2b 100644 --- a/clinicfinder/serializers.py +++ b/clinicfinder/serializers.py @@ -4,7 +4,7 @@ class LocationSerializer(GeoModelSerializer): - """ A class to serialize locations""" + """A class to serialize locations""" longitude = serializers.FloatField(required=True) latitude = serializers.FloatField(required=True) diff --git a/clinicfinder/tests/test_views.py b/clinicfinder/tests/test_views.py index 382183f..ba7473a 100644 --- a/clinicfinder/tests/test_views.py +++ b/clinicfinder/tests/test_views.py @@ -12,7 +12,7 @@ class ClinicFinderViewTests(APITestCase): @override_settings(LOCATION_SEARCH_RADIUS=100) def test_clinic_finder_list(self): """ - Returns a list of the nearest clinics + Returns a list of the nearest clinics """ user = get_user_model().objects.create_user("test") user.user_permissions.add(Permission.objects.get(codename="add_covid19triage")) @@ -25,7 +25,7 @@ def test_clinic_finder_list(self): def test_clinic_finder_error(self): """ - Returns an error if longitude or latitude is not provided + Returns an error if longitude or latitude is not provided """ user = get_user_model().objects.create_user("test") user.user_permissions.add(Permission.objects.get(codename="add_covid19triage")) diff --git a/clinicfinder/urls.py b/clinicfinder/urls.py index 77ebe32..30c417c 100644 --- a/clinicfinder/urls.py +++ b/clinicfinder/urls.py @@ -5,5 +5,9 @@ app_name = "clinicfinder" urlpatterns = [ - path("clinic_finder/", ClinicFinderView.as_view(), name="clinic_finder",), + path( + "clinic_finder/", + ClinicFinderView.as_view(), + name="clinic_finder", + ), ] diff --git a/contacts/migrations/0002_auto_20200721_1306.py b/contacts/migrations/0002_auto_20200721_1306.py index bcd89d4..63918a6 100644 --- a/contacts/migrations/0002_auto_20200721_1306.py +++ b/contacts/migrations/0002_auto_20200721_1306.py @@ -11,7 +11,10 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="contact", name="cases",), + migrations.RemoveField( + model_name="contact", + name="cases", + ), migrations.AddField( model_name="case", name="contact", diff --git a/contacts/models.py b/contacts/models.py index 34cd15d..d742354 100644 --- a/contacts/models.py +++ b/contacts/models.py @@ -58,7 +58,10 @@ def up_for_notification(self): class Case(ExportModelOperationsMixin("case"), models.Model): external_id = models.CharField( - max_length=255, blank=False, default=get_uuid, unique=True, + max_length=255, + blank=False, + default=get_uuid, + unique=True, ) date_start = models.DateTimeField(null=False, auto_now_add=False) date_notification_start = models.DateTimeField(null=True, auto_now_add=False) @@ -66,10 +69,16 @@ class Case(ExportModelOperationsMixin("case"), models.Model): case_id = models.CharField(blank=True, null=True, max_length=50) name = models.CharField(blank=True, null=True, max_length=30) created_by = models.ForeignKey( - User, related_name="cases", on_delete=models.SET_NULL, null=True, + User, + related_name="cases", + on_delete=models.SET_NULL, + null=True, ) contact = models.ForeignKey( - Contact, null=True, related_name="cases", on_delete=models.SET_NULL, + Contact, + null=True, + related_name="cases", + on_delete=models.SET_NULL, ) created_at = models.DateTimeField(auto_now_add=True) is_active = models.BooleanField(default=True) diff --git a/contacts/tasks.py b/contacts/tasks.py index 2b3d081..53e7fe0 100644 --- a/contacts/tasks.py +++ b/contacts/tasks.py @@ -49,7 +49,9 @@ def send_contact_update(phone_number, confirmed_contact, case_id): # case started case.date_notification_start = timezone.now() case.save( - update_fields=["date_notification_start",] # noqa: E231 E126 E261 + update_fields=[ + "date_notification_start", + ] # noqa: E231 E126 E261 ) else: # case ended diff --git a/contacts/tests.py b/contacts/tests.py index 6356cb5..9db1780 100644 --- a/contacts/tests.py +++ b/contacts/tests.py @@ -22,13 +22,15 @@ def setUp(self): self.client = Client() admin = User.objects.create_superuser( - username="testadmin", password="testadminpassword", + username="testadmin", + password="testadminpassword", ) logger.info("Created superuser") self.client.login( - username="testadmin", password="testadminpassword", + username="testadmin", + password="testadminpassword", ) logger.info("Logged in with superuser") diff --git a/covid_cases/tests.py b/covid_cases/tests.py index fc9bf4f..5d5a7ed 100644 --- a/covid_cases/tests.py +++ b/covid_cases/tests.py @@ -196,7 +196,9 @@ class ScrapeSACoronavirusHomepageTests(APITestCase): def test_scrape_sacoronavirus_hompage(self): with gzip.open("covid_cases/mock_data/sacoronavirus.txt.gz") as f: responses.add( - method="GET", url="https://sacoronavirus.co.za", body=f.read(), + method="GET", + url="https://sacoronavirus.co.za", + body=f.read(), ) result = scrape_sacoronavirus_homepage() self.assertIn("tests=19988045", result) diff --git a/healthcheck/utils.py b/healthcheck/utils.py index 9c19153..3f1c1b1 100644 --- a/healthcheck/utils.py +++ b/healthcheck/utils.py @@ -13,10 +13,14 @@ def get_bigquery_client(key_path): if os.path.isfile(key_path): credentials = service_account.Credentials.from_service_account_file( - key_path, scopes=["https://www.googleapis.com/auth/cloud-platform"], + key_path, + scopes=["https://www.googleapis.com/auth/cloud-platform"], ) - return bigquery.Client(credentials=credentials, project=credentials.project_id,) + return bigquery.Client( + credentials=credentials, + project=credentials.project_id, + ) def get_latest_bigquery_timestamp(bigquery_client, dataset, model, field): diff --git a/requirements-dev.txt b/requirements-dev.txt index 0a3e3e6..4b2ee5a 100755 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,3 @@ -isort==4.3.21 -black==19.10b0 -flake8==3.8.1 +isort==5.13.2 +black==24.1.1 +flake8==7.0.0 diff --git a/selfswab/tests/test_utils.py b/selfswab/tests/test_utils.py index ac92d3a..9f697c8 100644 --- a/selfswab/tests/test_utils.py +++ b/selfswab/tests/test_utils.py @@ -36,7 +36,8 @@ def test_is_barcode_format_valid(self): class UploadTurnMediaTests(TestCase): @responses.activate @override_settings( - SELFSWAB_TURN_URL="https://turn.io", SELFSWAB_TURN_TOKEN="321", + SELFSWAB_TURN_URL="https://turn.io", + SELFSWAB_TURN_TOKEN="321", ) def test_upload_turn_media(self): @@ -59,7 +60,8 @@ def test_upload_turn_media(self): class SendWhatsAppMediaTests(TestCase): @responses.activate @override_settings( - SELFSWAB_TURN_URL="https://turn.io", SELFSWAB_TURN_TOKEN="321", + SELFSWAB_TURN_URL="https://turn.io", + SELFSWAB_TURN_TOKEN="321", ) def test_send_whatsapp_media_message(self): responses.add( diff --git a/selfswab/tests/test_views.py b/selfswab/tests/test_views.py index 4dcdc0c..62039c3 100644 --- a/selfswab/tests/test_views.py +++ b/selfswab/tests/test_views.py @@ -341,7 +341,8 @@ def test_rapidpro_not_configured(self): @responses.activate @override_settings( - RAPIDPRO_URL="https://rp-test.com", SELFSWAB_RAPIDPRO_TOKEN="123", + RAPIDPRO_URL="https://rp-test.com", + SELFSWAB_RAPIDPRO_TOKEN="123", ) def test_contact_not_found(self): user = get_user_model().objects.create_user("test") @@ -401,7 +402,8 @@ def test_contact_not_found(self): @responses.activate @override_settings( - RAPIDPRO_URL="https://rp-test.com", SELFSWAB_RAPIDPRO_TOKEN="123", + RAPIDPRO_URL="https://rp-test.com", + SELFSWAB_RAPIDPRO_TOKEN="123", ) def test_contact_exists_not_in_group(self): user = get_user_model().objects.create_user("test") @@ -514,7 +516,8 @@ def test_contact_exists_not_in_group(self): @responses.activate @override_settings( - RAPIDPRO_URL="https://rp-test.com", SELFSWAB_RAPIDPRO_TOKEN="123", + RAPIDPRO_URL="https://rp-test.com", + SELFSWAB_RAPIDPRO_TOKEN="123", ) def test_contact_exists_in_group(self): user = get_user_model().objects.create_user("test") @@ -597,7 +600,12 @@ class SendTestResultPDFViewViewSetTests(APITestCase): def test_unautorized(self): user = get_user_model().objects.create_user("test") - response = self.client.post(self.url, {"barcode": "CP123",},) + response = self.client.post( + self.url, + { + "barcode": "CP123", + }, + ) self.assertEqual(response.status_code, 401) @@ -605,7 +613,12 @@ def test_barcode_not_found(self): user = get_user_model().objects.create_user("test") self.client.force_authenticate(user) - response = self.client.post(self.url, {"barcode": "CP123",},) + response = self.client.post( + self.url, + { + "barcode": "CP123", + }, + ) self.assertEqual(response.status_code, 404) @@ -623,7 +636,12 @@ def test_send_result_pdf(self, mock_send_whatsapp_media_message): } ) - response = self.client.post(self.url, {"barcode": "CP159600001",},) + response = self.client.post( + self.url, + { + "barcode": "CP159600001", + }, + ) self.assertEqual(response.status_code, 200) diff --git a/selfswab/utils.py b/selfswab/utils.py index b3400d3..49dd05d 100644 --- a/selfswab/utils.py +++ b/selfswab/utils.py @@ -38,7 +38,9 @@ def upload_turn_media(media, content_type="application/pdf"): } response = requests.post( - urljoin(settings.SELFSWAB_TURN_URL, f"v1/media"), headers=headers, data=media, + urljoin(settings.SELFSWAB_TURN_URL, f"v1/media"), + headers=headers, + data=media, ) response.raise_for_status() return response.json()["media"][0]["id"] diff --git a/tbconnect/migrations/0006_auto_20200908_1655.py b/tbconnect/migrations/0006_auto_20200908_1655.py index 2699291..8bbf2bf 100644 --- a/tbconnect/migrations/0006_auto_20200908_1655.py +++ b/tbconnect/migrations/0006_auto_20200908_1655.py @@ -11,7 +11,9 @@ class Migration(migrations.Migration): operations = [ migrations.AlterField( - model_name="tbcheck", name="cough", field=models.BooleanField(), + model_name="tbcheck", + name="cough", + field=models.BooleanField(), ), migrations.AlterField( model_name="tbcheck", diff --git a/tbconnect/migrations/0011_remove_tbcheck_group_arm.py b/tbconnect/migrations/0011_remove_tbcheck_group_arm.py index 3014a54..72db0cd 100644 --- a/tbconnect/migrations/0011_remove_tbcheck_group_arm.py +++ b/tbconnect/migrations/0011_remove_tbcheck_group_arm.py @@ -10,5 +10,8 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="tbcheck", name="group_arm",), + migrations.RemoveField( + model_name="tbcheck", + name="group_arm", + ), ] diff --git a/tbconnect/tasks.py b/tbconnect/tasks.py index ee92000..d89356a 100644 --- a/tbconnect/tasks.py +++ b/tbconnect/tasks.py @@ -46,8 +46,10 @@ def perform_sync_to_rapidpro(): tbconnect_group_arm_timestamp = None if contact.tbconnect_group_arm_timestamp: - tbconnect_group_arm_timestamp = contact.tbconnect_group_arm_timestamp.strftime( - "%Y-%m-%dT%H:%M:%SZ" + tbconnect_group_arm_timestamp = ( + contact.tbconnect_group_arm_timestamp.strftime( + "%Y-%m-%dT%H:%M:%SZ" + ) ) rapidpro.create_flow_start( urns=[urn], diff --git a/tbconnect/tests/test_views.py b/tbconnect/tests/test_views.py index a0a5157..47a9269 100644 --- a/tbconnect/tests/test_views.py +++ b/tbconnect/tests/test_views.py @@ -533,7 +533,9 @@ def test_valid_tbcheck(self): class TBResetViewSetTests(APITestCase): url = reverse("tbreset-detail", args=("+27856454612",)) - @override_settings(ALLOW_TB_RESET_MSISDNS=["+27820010001"],) + @override_settings( + ALLOW_TB_RESET_MSISDNS=["+27820010001"], + ) def test_reset_not_allowed(self): """ The supplied msisdn is not reset when not allowed. @@ -544,7 +546,9 @@ def test_reset_not_allowed(self): response = self.client.get(self.url) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) - @override_settings(ALLOW_TB_RESET_MSISDNS=["+27856454612"],) + @override_settings( + ALLOW_TB_RESET_MSISDNS=["+27856454612"], + ) def test_reset_allowed(self): """ The whitelisted msisdn is allowed to be reset. @@ -644,10 +648,13 @@ def test_activation_active(self): response = self.client.post(self.url, {"activation": "tb_study_a"}) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual( - response.json(), {"is_activation_active": False}, + response.json(), + {"is_activation_active": False}, ) - @override_settings(TB_STUDY_A_END_DATE="2023-10-16",) + @override_settings( + TB_STUDY_A_END_DATE="2023-10-16", + ) def test_activation_inactive_out_of_date(self): """ If we've reached the end date, return False @@ -658,10 +665,13 @@ def test_activation_inactive_out_of_date(self): response = self.client.post(self.url, {"activation": "tb_study_a"}) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual( - response.json(), {"is_activation_active": False}, + response.json(), + {"is_activation_active": False}, ) - @override_settings(TB_STUDY_A_MAX_COUNT=1,) + @override_settings( + TB_STUDY_A_MAX_COUNT=1, + ) def test_activation_inactive_max_count(self): """ If we've reached the max count, return False @@ -675,5 +685,6 @@ def test_activation_inactive_max_count(self): response = self.client.post(self.url, {"activation": "tb_study_a"}) self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual( - response.json(), {"is_activation_active": False}, + response.json(), + {"is_activation_active": False}, ) diff --git a/userprofile/migrations/0003_auto_20200814_1416.py b/userprofile/migrations/0003_auto_20200814_1416.py index c771e21..65b57d0 100644 --- a/userprofile/migrations/0003_auto_20200814_1416.py +++ b/userprofile/migrations/0003_auto_20200814_1416.py @@ -11,7 +11,8 @@ class Migration(migrations.Migration): operations = [ migrations.RemoveIndex( - model_name="covid19triage", name="userprofile_msisdn_8da1c7_idx", + model_name="covid19triage", + name="userprofile_msisdn_8da1c7_idx", ), migrations.AddIndex( model_name="covid19triage", @@ -20,9 +21,11 @@ class Migration(migrations.Migration): ), ), migrations.AlterModelTable( - name="covid19triage", table="eventstore_covid19triage", + name="covid19triage", + table="eventstore_covid19triage", ), migrations.AlterModelTable( - name="healthcheckuserprofile", table="eventstore_healthcheckuserprofile", + name="healthcheckuserprofile", + table="eventstore_healthcheckuserprofile", ), ] diff --git a/userprofile/tests/test_models.py b/userprofile/tests/test_models.py index 3c2d578..269fc6b 100755 --- a/userprofile/tests/test_models.py +++ b/userprofile/tests/test_models.py @@ -205,7 +205,9 @@ def test_update_tbconnect_group_arm_no_consent(self): self.assertIsNone(profile.tbconnect_group_arm) self.assertIsNone(profile.tbconnect_group_arm_timestamp) - @override_settings(SOFT_COMMITMENT_PLUS_LIMIT=0,) + @override_settings( + SOFT_COMMITMENT_PLUS_LIMIT=0, + ) def test_get_tb_study_arms_forced_exclude(self): """ Exclude soft commitment plus if setting is 0 @@ -255,7 +257,9 @@ def test_get_tb_study_arms_exclude(self): arms = profile._get_tb_study_arms() self.assertEqual(len(arms), 1) - @override_settings(SOFT_COMMITMENT_PLUS_LIMIT=10,) + @override_settings( + SOFT_COMMITMENT_PLUS_LIMIT=10, + ) def test_get_tb_study_arms_include_soft_commit_plus(self): """ Include soft commitment plus if setting is not 0 diff --git a/userprofile/views.py b/userprofile/views.py index 9fde76f..c62384d 100755 --- a/userprofile/views.py +++ b/userprofile/views.py @@ -99,13 +99,13 @@ class Covid19TriageV2ViewSet(Covid19TriageViewSet): } def _get_msisdn(self, data): - """ Gets the MSISDN from the data, or raises a ValidationError """ + """Gets the MSISDN from the data, or raises a ValidationError""" serializer = MSISDNSerializer(data=data) serializer.is_valid(raise_exception=True) return serializer.validated_data["msisdn"] def _update_data(self, data, triage): - """ Updates the data from the values in triage """ + """Updates the data from the values in triage""" for field in self.returning_user_skipped_fields: value = getattr(triage, field) if value: diff --git a/users/admin.py b/users/admin.py index 199e01c..8889f44 100755 --- a/users/admin.py +++ b/users/admin.py @@ -102,7 +102,10 @@ class UserAdmin(BaseUserAdmin): None, { "classes": ("wide",), - "fields": ("username", "password",), + "fields": ( + "username", + "password", + ), }, # noqa: E231, E501 ), ) diff --git a/users/migrations/0001_initial.py b/users/migrations/0001_initial.py index 8b31d5b..e8ea25f 100755 --- a/users/migrations/0001_initial.py +++ b/users/migrations/0001_initial.py @@ -98,7 +98,12 @@ class Migration(migrations.Migration): ), ), ], - options={"db_table": "users", "ordering": ["-date_joined"],}, - managers=[("objects", users.models.UserManager()),], + options={ + "db_table": "users", + "ordering": ["-date_joined"], + }, + managers=[ + ("objects", users.models.UserManager()), + ], ), ] diff --git a/users/migrations/0003_auto_20200716_1408.py b/users/migrations/0003_auto_20200716_1408.py index aa50cfd..2e7869d 100755 --- a/users/migrations/0003_auto_20200716_1408.py +++ b/users/migrations/0003_auto_20200716_1408.py @@ -10,7 +10,16 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="user", name="first_name",), - migrations.RemoveField(model_name="user", name="last_name",), - migrations.RemoveField(model_name="user", name="phone_number",), + migrations.RemoveField( + model_name="user", + name="first_name", + ), + migrations.RemoveField( + model_name="user", + name="last_name", + ), + migrations.RemoveField( + model_name="user", + name="phone_number", + ), ] diff --git a/users/migrations/0004_remove_user_email.py b/users/migrations/0004_remove_user_email.py index b048ebd..b140b0a 100755 --- a/users/migrations/0004_remove_user_email.py +++ b/users/migrations/0004_remove_user_email.py @@ -10,5 +10,8 @@ class Migration(migrations.Migration): ] operations = [ - migrations.RemoveField(model_name="user", name="email",), + migrations.RemoveField( + model_name="user", + name="email", + ), ] diff --git a/users/tests.py b/users/tests.py index 87c9f57..3c7cd1a 100755 --- a/users/tests.py +++ b/users/tests.py @@ -14,13 +14,15 @@ def setUp(self): self.client = Client() User.objects.all().delete() User.objects.create_superuser( - username="testadmin", password="testadminpassword", + username="testadmin", + password="testadminpassword", ) logger.info("Created superuser") self.client.login( - username="testadmin", password="testadminpassword", + username="testadmin", + password="testadminpassword", ) logger.info("Logged in with superuser")