[Freedombox-pkg-team] Bug#1134826: django-axes: Please fix compatibility with Django 5.x
Chris Lamb
lamby at debian.org
Fri Apr 24 19:42:35 BST 2026
Source: django-axes
Version: 5.39.0-6
Severity: normal
Tags: patch
Hi,
I'm in the process of preparing unstable for an upload of Django 5.2. To
this end, please apply the following patch which applies two changes from
upstream to fixes a number of broken tests when run with that newer
version.
These changes are backwards compatible with Django version 4.2 that is
currently in unstable. I am using "Severity: normal" as I hope to upload
Django 5.2 shortly, but feel free to adjust.
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
diff --git debian/patches/0004-PATCH-fix-logout-tests.patch debian/patches/0004-PATCH-fix-logout-tests.patch
new file mode 100644
index 0000000..d6761ef
--- /dev/null
+++ debian/patches/0004-PATCH-fix-logout-tests.patch
@@ -0,0 +1,40 @@
+From: Maksim Zayakin <rasetsu at list.ru>
+Date: Sat, 1 Apr 2023 16:28:07 +0500
+Subject: [PATCH] fix logout tests
+
+Source: upstream, https://github.com/jazzband/django-axes/commit/25f690389925b2e545cbf2bbce0d30dab7dcd3d4.patch
+---
+ tests/test_logging.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/test_logging.py b/tests/test_logging.py
+index 7f73442..4e4579e 100644
+--- a/tests/test_logging.py
++++ b/tests/test_logging.py
+@@ -64,7 +64,7 @@ class AccessLogTestCase(AxesTestCase):
+ self.login(is_valid_username=True, is_valid_password=True)
+ self.assertIsNone(AccessLog.objects.latest("id").logout_time)
+
+- response = self.client.get(reverse("admin:logout"))
++ response = self.client.post(reverse("admin:logout"))
+ self.assertContains(response, "Logged out")
+
+ self.assertIsNotNone(AccessLog.objects.latest("id").logout_time)
+@@ -85,7 +85,7 @@ class AccessLogTestCase(AxesTestCase):
+ AccessLog.objects.all().delete()
+
+ response = self.login(is_valid_username=True, is_valid_password=True)
+- response = self.client.get(reverse("admin:logout"))
++ response = self.client.post(reverse("admin:logout"))
+
+ self.assertEqual(AccessLog.objects.all().count(), 0)
+ self.assertContains(response, "Logged out", html=True)
+@@ -108,7 +108,7 @@ class AccessLogTestCase(AxesTestCase):
+ AccessLog.objects.all().delete()
+
+ response = self.login(is_valid_username=True, is_valid_password=True)
+- response = self.client.get(reverse("admin:logout"))
++ response = self.client.post(reverse("admin:logout"))
+
+ self.assertEqual(AccessLog.objects.count(), 0)
+ self.assertContains(response, "Logged out", html=True)
diff --git debian/patches/0005-PATCH-Fix-failing-test-case-for-new-Django-versions.patch debian/patches/0005-PATCH-Fix-failing-test-case-for-new-Django-versions.patch
new file mode 100644
index 0000000..b8a2f3e
--- /dev/null
+++ debian/patches/0005-PATCH-Fix-failing-test-case-for-new-Django-versions.patch
@@ -0,0 +1,24 @@
+From: =?UTF-8?q?Aleksi=20H=C3=A4kli?= <aleksi.hakli at iki.fi>
+Date: Sat, 21 Sep 2024 11:32:34 +0300
+Subject: [PATCH] Fix failing test case for new Django versions
+
+See https://code.djangoproject.com/ticket/34968 for more details
+
+Source: upstream, https://github.com/jazzband/django-axes/commit/07483c6a157c503abb17ee1412cc53d07c2d8631.patch
+---
+ tests/test_logging.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_logging.py b/tests/test_logging.py
+index 4e4579e..7b49555 100644
+--- a/tests/test_logging.py
++++ b/tests/test_logging.py
+@@ -76,7 +76,7 @@ class AccessLogTestCase(AxesTestCase):
+ """
+
+ # An impossibly large post dict
+- extra_data = {"a" * x: x for x in range(1024)}
++ extra_data = {"too-large-field": "x" * 2 ** 16}
+ self.login(**extra_data)
+ self.assertEqual(len(AccessAttempt.objects.latest("id").post_data), 1024)
+
diff --git debian/patches/series debian/patches/series
index fd1afa6..d47ce12 100644
--- debian/patches/series
+++ debian/patches/series
@@ -1,3 +1,5 @@
0001-Adopt-test-based-on-Django-security-release.patch
0002-Remove-test-coverage.patch
0003-remove-dependency-on-pkg-resources.patch
+0004-PATCH-fix-logout-tests.patch
+0005-PATCH-Fix-failing-test-case-for-new-Django-versions.patch
More information about the Freedombox-pkg-team
mailing list