1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

[1.2.X] 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.

Backport of r15362 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2011-01-30 13:20:00 +00:00
parent a289eba59c
commit 7e83c3b91f
2 changed files with 9 additions and 2 deletions

View File

@@ -24,6 +24,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[:]