diff options
| author | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-02-27 14:43:55 -0500 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-03-02 14:08:42 -0500 |
| commit | 1b22d53bf67943cd193bbd6e327d955c19d2f5d2 (patch) | |
| tree | 74b0eb2f02a0642d40426e2f841e80746219e43d /tests | |
| parent | 27ed90a8a829aa25f2ff3dc121f8429c2b06f662 (diff) | |
[6.0.x] Fixed #36961 -- Fixed TypeError in deprecation warnings if Django is imported by namespace.
Backport of c1d8646ec219b8b90ebdd463f40e5767876658a0 from main.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/deprecation/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/deprecation/tests.py b/tests/deprecation/tests.py index 2df9cc6fa2..ac610b4928 100644 --- a/tests/deprecation/tests.py +++ b/tests/deprecation/tests.py @@ -18,6 +18,10 @@ class DjangoFilePrefixesTests(SimpleTestCase): def test_no_file(self): orig_file = django.__file__ try: + # Depending on the cwd, Python might give a local checkout + # precedence over installed Django, producing None. + django.__file__ = None + self.assertEqual(django_file_prefixes(), ()) del django.__file__ self.assertEqual(django_file_prefixes(), ()) finally: |
