summaryrefslogtreecommitdiff
path: root/tests/regressiontests/utils/module_loading.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-01-30 13:10:47 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-01-30 13:10:47 +0000
commit56ebab9d8596f63db38053816ec961656e49ed38 (patch)
tree651e01d1b8f3e80defbe3c4101de67b44f8fea1d /tests/regressiontests/utils/module_loading.py
parent4392c8e67ed6009602ff72af0a786c1053d55302 (diff)
Fixed #14698 -- Ensure that module_has_sumodule doesn't mistake a cache miss for an existent package. Thanks to Łukasz Rekucki for the report and patch, and to shields for the test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15362 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/utils/module_loading.py')
-rw-r--r--tests/regressiontests/utils/module_loading.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/regressiontests/utils/module_loading.py b/tests/regressiontests/utils/module_loading.py
index cffec9bad9..24c0b0753f 100644
--- a/tests/regressiontests/utils/module_loading.py
+++ b/tests/regressiontests/utils/module_loading.py
@@ -25,6 +25,10 @@ class DefaultLoader(unittest.TestCase):
self.assertFalse(module_has_submodule(test_module, 'no_such_module'))
self.assertRaises(ImportError, import_module, 'regressiontests.utils.test_module.no_such_module')
+ # Don't be confused by caching of import misses
+ import types # causes attempted import of regressiontests.utils.types
+ self.assertFalse(module_has_submodule(sys.modules['regressiontests.utils'], 'types'))
+
class EggLoader(unittest.TestCase):
def setUp(self):
self.old_path = sys.path[:]