From 02ab0c9398b170dc6b6d62479c24ff82924f538c Mon Sep 17 00:00:00 2001 From: MehrazRumman Date: Tue, 4 Nov 2025 00:35:31 +0600 Subject: [PATCH 01/12] adding django6.0a support --- .gitignore | 1 + tox.ini | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 641714d163..22ec6a3620 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ /env/ MANIFEST coverage.* +venv/ !.github !.gitignore diff --git a/tox.ini b/tox.ini index cbaaf159e5..c002299e99 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,8 @@ envlist = {py310}-{django42,django51,django52} {py311}-{django42,django51,django52} - {py312}-{django42,django51,django52,djangomain} - {py313}-{django51,django52,djangomain} + {py312}-{django42,django51,django52,django60,djangomain} + {py313}-{django51,django52,django60,djangomain} {py314}-{django52,djangomain} base dist @@ -20,6 +20,7 @@ deps = django50: Django>=5.0,<5.1 django51: Django>=5.1,<5.2 django52: Django>=5.2,<6.0 + django60: Django>=6.0b1,<6.1 djangomain: https://github.com/django/django/archive/main.tar.gz -rrequirements/requirements-testing.txt -rrequirements/requirements-optionals.txt From 2ba9c898f209553c9f3ea97ff86aa3e3798c8359 Mon Sep 17 00:00:00 2001 From: MehrazRumman Date: Tue, 4 Nov 2025 01:52:05 +0600 Subject: [PATCH 02/12] test fixed --- tests/test_templatetags.py | 5 +++-- tests/test_validators.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index 7134c1bae0..0ce754453a 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -1,7 +1,7 @@ import unittest from django.template import Context, Template -from django.test import TestCase +from django.test import TestCase, override_settings from django.utils.html import urlize from rest_framework.compat import coreapi, coreschema @@ -240,6 +240,7 @@ class Issue1386Tests(TestCase): Covers #1386 """ + @override_settings(URLIZE_ASSUME_HTTPS=True) def test_issue_1386(self): """ Test function urlize with different args @@ -248,7 +249,6 @@ def test_issue_1386(self): "asdf.com", "asdf.net", "www.as_df.org", - "as.d8f.ghj8.gov", ] for i in correct_urls: res = urlize(i) @@ -258,6 +258,7 @@ def test_issue_1386(self): incorrect_urls = [ "mailto://asdf@fdf.com", "asdf.netnet", + "as.d8f.ghj8.gov", ] for i in incorrect_urls: res = urlize(i) diff --git a/tests/test_validators.py b/tests/test_validators.py index 79d4c0cf81..f27ffb2b5e 100644 --- a/tests/test_validators.py +++ b/tests/test_validators.py @@ -752,7 +752,7 @@ def test_single_field_uniq_validators(self): validators = serializer.fields['fancy_conditions'].validators assert len(validators) == 2 + extra_validators_qty - ids_in_qs = {frozenset(v.queryset.values_list(flat=True)) for v in validators if hasattr(v, "queryset")} + ids_in_qs = {frozenset(v.queryset.values_list('id',flat=True)) for v in validators if hasattr(v, "queryset")} assert ids_in_qs == {frozenset([1]), frozenset([3])} def test_nullable_unique_constraint_fields_are_not_required(self): From 3a513bccb47007c0f1261ae1b11d145c9435b9e1 Mon Sep 17 00:00:00 2001 From: MehrazRumman Date: Tue, 4 Nov 2025 01:52:39 +0600 Subject: [PATCH 03/12] gitignore updated --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 22ec6a3620..641714d163 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ /env/ MANIFEST coverage.* -venv/ !.github !.gitignore From 6e828f84571161594fbdcbd63ff1bc368e8ac8db Mon Sep 17 00:00:00 2001 From: MehrazRumman Date: Tue, 4 Nov 2025 01:58:33 +0600 Subject: [PATCH 04/12] pre-commit applied --- tests/test_validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_validators.py b/tests/test_validators.py index f27ffb2b5e..96354b9b13 100644 --- a/tests/test_validators.py +++ b/tests/test_validators.py @@ -752,7 +752,7 @@ def test_single_field_uniq_validators(self): validators = serializer.fields['fancy_conditions'].validators assert len(validators) == 2 + extra_validators_qty - ids_in_qs = {frozenset(v.queryset.values_list('id',flat=True)) for v in validators if hasattr(v, "queryset")} + ids_in_qs = {frozenset(v.queryset.values_list('id', flat=True)) for v in validators if hasattr(v, "queryset")} assert ids_in_qs == {frozenset([1]), frozenset([3])} def test_nullable_unique_constraint_fields_are_not_required(self): From 3c23f56e85bd8558d3b25d3339c617d1094dbd73 Mon Sep 17 00:00:00 2001 From: MehrazRumman Date: Tue, 4 Nov 2025 02:03:12 +0600 Subject: [PATCH 05/12] test issue 1386 fixed --- tests/test_templatetags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index 0ce754453a..8260fc839b 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -249,6 +249,7 @@ def test_issue_1386(self): "asdf.com", "asdf.net", "www.as_df.org", + "as.d8f.ghj8.gov", ] for i in correct_urls: res = urlize(i) @@ -258,7 +259,6 @@ def test_issue_1386(self): incorrect_urls = [ "mailto://asdf@fdf.com", "asdf.netnet", - "as.d8f.ghj8.gov", ] for i in incorrect_urls: res = urlize(i) From 1f509639ca741263600fe8fb2d3eac5ce80491a9 Mon Sep 17 00:00:00 2001 From: MehrazRumman Date: Tue, 4 Nov 2025 02:12:34 +0600 Subject: [PATCH 06/12] fixing test issue 1386 --- tests/test_templatetags.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index 8260fc839b..a4cdb344a8 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -249,7 +249,6 @@ def test_issue_1386(self): "asdf.com", "asdf.net", "www.as_df.org", - "as.d8f.ghj8.gov", ] for i in correct_urls: res = urlize(i) From f757520ce95326c1e91c018144046db773fb67c8 Mon Sep 17 00:00:00 2001 From: MehrazRumman Date: Wed, 5 Nov 2025 18:48:54 +0600 Subject: [PATCH 07/12] .gov domain handled for different version --- tests/test_templatetags.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index a4cdb344a8..072796628c 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -1,5 +1,6 @@ import unittest +import django from django.template import Context, Template from django.test import TestCase, override_settings from django.utils.html import urlize @@ -250,6 +251,8 @@ def test_issue_1386(self): "asdf.net", "www.as_df.org", ] + if django.VERSION < (5, 3): + correct_urls.append("as.d8f.ghj8.gov") for i in correct_urls: res = urlize(i) self.assertNotEqual(res, i) @@ -259,6 +262,8 @@ def test_issue_1386(self): "mailto://asdf@fdf.com", "asdf.netnet", ] + if django.VERSION >= (5, 3): + incorrect_urls.append("as.d8f.ghj8.gov") for i in incorrect_urls: res = urlize(i) self.assertEqual(i, res) From 71cac840d3b739743abc8c2b6b21ee6dc63823a0 Mon Sep 17 00:00:00 2001 From: MehrazRumman Date: Thu, 6 Nov 2025 12:26:29 +0600 Subject: [PATCH 08/12] correct urls updated --- tests/test_templatetags.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index 072796628c..8260fc839b 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -1,6 +1,5 @@ import unittest -import django from django.template import Context, Template from django.test import TestCase, override_settings from django.utils.html import urlize @@ -250,9 +249,8 @@ def test_issue_1386(self): "asdf.com", "asdf.net", "www.as_df.org", + "as.d8f.ghj8.gov", ] - if django.VERSION < (5, 3): - correct_urls.append("as.d8f.ghj8.gov") for i in correct_urls: res = urlize(i) self.assertNotEqual(res, i) @@ -262,8 +260,6 @@ def test_issue_1386(self): "mailto://asdf@fdf.com", "asdf.netnet", ] - if django.VERSION >= (5, 3): - incorrect_urls.append("as.d8f.ghj8.gov") for i in incorrect_urls: res = urlize(i) self.assertEqual(i, res) From 813ee9de3d626a434419d92baa07daf988934d50 Mon Sep 17 00:00:00 2001 From: Mehraz Hossain Rumman <59512321+MehrazRumman@users.noreply.github.com> Date: Thu, 6 Nov 2025 12:38:58 +0600 Subject: [PATCH 09/12] Modify URL test cases for Django version compatibility Adjust URL test cases based on Django version. --- tests/test_templatetags.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index 8260fc839b..4822ea3c57 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -249,8 +249,9 @@ def test_issue_1386(self): "asdf.com", "asdf.net", "www.as_df.org", - "as.d8f.ghj8.gov", ] + if django.VERSION < (5, 3): + correct_urls.append("as.d8f.ghj8.gov") for i in correct_urls: res = urlize(i) self.assertNotEqual(res, i) @@ -260,6 +261,8 @@ def test_issue_1386(self): "mailto://asdf@fdf.com", "asdf.netnet", ] + if django.VERSION >= (5, 3): + incorrect_urls.append("as.d8f.ghj8.gov") for i in incorrect_urls: res = urlize(i) self.assertEqual(i, res) From d68ca125eef25a38618c28073b1dc63caed3be7d Mon Sep 17 00:00:00 2001 From: Mehraz Hossain Rumman <59512321+MehrazRumman@users.noreply.github.com> Date: Thu, 6 Nov 2025 12:40:25 +0600 Subject: [PATCH 10/12] Add Django import to test_templatetags.py --- tests/test_templatetags.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index 4822ea3c57..eaa0363bd7 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -1,4 +1,5 @@ import unittest +import django from django.template import Context, Template from django.test import TestCase, override_settings From 88de7cfc80d2f2260c26ff887f2566610c1fbcb3 Mon Sep 17 00:00:00 2001 From: Mehraz Hossain Rumman <59512321+MehrazRumman@users.noreply.github.com> Date: Thu, 6 Nov 2025 12:41:57 +0600 Subject: [PATCH 11/12] Reorder import statements in test file --- tests/test_templatetags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_templatetags.py b/tests/test_templatetags.py index eaa0363bd7..072796628c 100644 --- a/tests/test_templatetags.py +++ b/tests/test_templatetags.py @@ -1,6 +1,6 @@ import unittest -import django +import django from django.template import Context, Template from django.test import TestCase, override_settings from django.utils.html import urlize From aeda9fff04286e6f0da39b5d0aae8acf0f8bcb34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asif=20Saif=20Uddin=20=7B=22Auvi=22=3A=22=E0=A6=85?= =?UTF-8?q?=E0=A6=AD=E0=A6=BF=22=7D?= Date: Thu, 6 Nov 2025 13:39:21 +0600 Subject: [PATCH 12/12] Update tox.ini --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index c002299e99..0d609854a7 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ envlist = {py311}-{django42,django51,django52} {py312}-{django42,django51,django52,django60,djangomain} {py313}-{django51,django52,django60,djangomain} - {py314}-{django52,djangomain} + {py314}-{django52,django60,djangomain} base dist docs