summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFashad Ahmed <fashad.ahmed20@gmail.com>2026-04-28 22:38:36 +0200
committerJacob Walls <jacobtylerwalls@gmail.com>2026-04-29 13:47:49 -0400
commit60a9c70496e5d7b971928ce3da5b47c8836a4def (patch)
treee71929c9bb10385c026625b4adbae8f5a23dea12 /tests
parent61941b6fc172933f425e8ba76bab444ab9b313e4 (diff)
Fixed #37067 -- Added trailing slash in django_file_prefixes().
Ensure skip_file_prefixes does not match sibling packages like django*. Bug in f42b89f1bf49a5b89ed852b60f79342320a81c5e and 34bd3ed944bf38792c631b55e581963d44d52284.
Diffstat (limited to 'tests')
-rw-r--r--tests/deprecation/tests.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/deprecation/tests.py b/tests/deprecation/tests.py
index ac610b4928..0993e8a450 100644
--- a/tests/deprecation/tests.py
+++ b/tests/deprecation/tests.py
@@ -1,5 +1,6 @@
import os
import warnings
+from pathlib import Path
import django
from django.test import SimpleTestCase
@@ -31,7 +32,11 @@ class DjangoFilePrefixesTests(SimpleTestCase):
prefixes = django_file_prefixes()
self.assertIsInstance(prefixes, tuple)
self.assertEqual(len(prefixes), 1)
- self.assertTrue(prefixes[0].endswith(f"{os.path.sep}django"))
+ self.assertTrue(prefixes[0].endswith(f"{os.path.sep}django{os.path.sep}"))
+
+ def test_does_not_match_packages_prefixed_with_django(self):
+ other_file = Path(django.__file__).parent.parent / "djangoextra" / "__init__.py"
+ self.assertFalse(str(other_file).startswith(django_file_prefixes()))
class RenameManagerMethods(RenameMethodsBase):