.gov domain handled for different version

This commit is contained in:
MehrazRumman 2025-11-05 18:48:54 +06:00
parent 1f509639ca
commit f757520ce9

View File

@ -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 @@ class Issue1386Tests(TestCase):
"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 @@ class Issue1386Tests(TestCase):
"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)