diff options
author | Caio Ariede <caio.ariede@gmail.com> | 2015-08-23 21:07:00 -0300 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-09-02 15:27:41 -0400 |
commit | 6a98396b9da56bf5eb1c94e037b844eb9bdd1a45 (patch) | |
tree | 3e6507bc4f92ade4788a2ff18a14103a488687eb /tests/apps | |
parent | 722bf23518afad6fd90694c17484da33551e4cef (diff) | |
download | django-6a98396b9da56bf5eb1c94e037b844eb9bdd1a45.tar.gz |
Fixed #25246 -- Guarded against duplicate paths in AppConfig.
Diffstat (limited to 'tests/apps')
-rw-r--r-- | tests/apps/tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/apps/tests.py b/tests/apps/tests.py index ae8f0c6c92..9e34773a77 100644 --- a/tests/apps/tests.py +++ b/tests/apps/tests.py @@ -365,6 +365,14 @@ class AppConfigTests(SimpleTestCase): with self.assertRaises(ImproperlyConfigured): AppConfig('label', Stub(__path__=['a', 'b'])) + def test_duplicate_dunder_path_no_dunder_file(self): + """ + If the __path__ attr contains duplicate paths and there is no + __file__, they duplicates should be deduplicated (#25246). + """ + ac = AppConfig('label', Stub(__path__=['a', 'a'])) + self.assertEqual(ac.path, 'a') + @skipUnless(six.PY3, "Namespace packages sans __init__.py were added in Python 3.3") class NamespacePackageAppTests(SimpleTestCase): |