summaryrefslogtreecommitdiff
path: root/tests/apps
diff options
context:
space:
mode:
authorCaio Ariede <caio.ariede@gmail.com>2015-08-23 21:07:00 -0300
committerTim Graham <timograham@gmail.com>2015-09-02 15:27:41 -0400
commit6a98396b9da56bf5eb1c94e037b844eb9bdd1a45 (patch)
tree3e6507bc4f92ade4788a2ff18a14103a488687eb /tests/apps
parent722bf23518afad6fd90694c17484da33551e4cef (diff)
downloaddjango-6a98396b9da56bf5eb1c94e037b844eb9bdd1a45.tar.gz
Fixed #25246 -- Guarded against duplicate paths in AppConfig.
Diffstat (limited to 'tests/apps')
-rw-r--r--tests/apps/tests.py8
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):