From 7a48859252a9fb8520f76b49316d27caf2fe4b97 Mon Sep 17 00:00:00 2001 From: Jonathan Reveille Date: Tue, 7 May 2024 15:45:37 +0200 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F(backend)=20upgrade=20to=20Dj?= =?UTF-8?q?ango=204.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some admin view tests required some adjustments. The count of strings in the admin template of Django has changed from version 4 to 4.1 of Django. --- CHANGELOG.md | 1 + pyproject.toml | 2 +- tests/apps/courses/test_admin_course_run.py | 42 ++++++++++----------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c82ac756e..2860ca59db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## Changed +- Upgrade to Django 4.1 version - Upgrade to Django 4.0 version and postgres to version 12 in docker compose file - Migrate to Sentry SDK 2.0 diff --git a/pyproject.toml b/pyproject.toml index 6019755b1d..d547b54d8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ "arrow", - "Django==4.0", + "Django==4.1", "djangocms-file", "djangocms-googlemap", "djangocms-link", diff --git a/tests/apps/courses/test_admin_course_run.py b/tests/apps/courses/test_admin_course_run.py index 2d9d635101..081c08021f 100644 --- a/tests/apps/courses/test_admin_course_run.py +++ b/tests/apps/courses/test_admin_course_run.py @@ -52,15 +52,15 @@ def test_admin_course_run_add_view(self): response = self.client.get(url, follow=True) # Check that the page includes all our fields - self.assertContains(response, "id_title") - self.assertContains(response, "id_resource_link") - self.assertContains(response, "id_start_", count=3) - self.assertContains(response, "id_end_", count=3) - self.assertContains(response, "id_enrollment_start_", count=3) - self.assertContains(response, "id_enrollment_end_", count=3) - self.assertContains(response, "id_languages") - self.assertContains(response, "id_enrollment_count") - self.assertContains(response, "id_sync_mode") + self.assertContains(response, "id_title", count=2) + self.assertContains(response, "id_resource_link", count=2) + self.assertContains(response, "id_start_", count=2) + self.assertContains(response, "id_end_", count=2) + self.assertContains(response, "id_enrollment_start_", count=2) + self.assertContains(response, "id_enrollment_end_", count=2) + self.assertContains(response, "id_languages", count=3) + self.assertContains(response, "id_enrollment_count", count=3) + self.assertContains(response, "id_sync_mode", count=2) # List @@ -208,12 +208,12 @@ def test_admin_course_run_change_view_get_superuser_draft(self): # Check that the page includes all our fields self.assertContains(response, "id_title", count=2) self.assertContains(response, "id_resource_link", count=2) - self.assertContains(response, "id_start_", count=3) - self.assertContains(response, "id_end_", count=3) - self.assertContains(response, "id_enrollment_start_", count=3) - self.assertContains(response, "id_enrollment_end_", count=3) - self.assertContains(response, "id_languages", count=2) - self.assertContains(response, "id_enrollment_count", count=2) + self.assertContains(response, "id_start_", count=2) + self.assertContains(response, "id_end_", count=2) + self.assertContains(response, "id_enrollment_start_", count=2) + self.assertContains(response, "id_enrollment_end_", count=2) + self.assertContains(response, "id_languages", count=3) + self.assertContains(response, "id_enrollment_count", count=3) self.assertContains(response, "id_sync_mode", count=2) def test_admin_course_run_change_view_get_superuser_public(self): @@ -319,12 +319,12 @@ def test_admin_course_run_change_view_get_staff_all_permissions(self): # Check that the page includes all our fields self.assertContains(response, "id_title", count=2) self.assertContains(response, "id_resource_link", count=2) - self.assertContains(response, "id_start_", count=3) - self.assertContains(response, "id_end_", count=3) - self.assertContains(response, "id_enrollment_start_", count=3) - self.assertContains(response, "id_enrollment_end_", count=3) - self.assertContains(response, "id_languages", count=2) - self.assertContains(response, "id_enrollment_count", count=2) + self.assertContains(response, "id_start_", count=2) + self.assertContains(response, "id_end_", count=2) + self.assertContains(response, "id_enrollment_start_", count=2) + self.assertContains(response, "id_enrollment_end_", count=2) + self.assertContains(response, "id_languages", count=3) + self.assertContains(response, "id_enrollment_count", count=3) self.assertContains(response, "id_sync_mode", count=2) # Add