mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
@@ -52,6 +52,7 @@ class DefaultLoader(unittest.TestCase):
|
||||
self.assertRaises(ImportError, import_module,
|
||||
'utils_tests.test_no_submodule.anything')
|
||||
|
||||
|
||||
class EggLoader(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.old_path = sys.path[:]
|
||||
@@ -133,6 +134,7 @@ class ModuleImportTestCase(unittest.TestCase):
|
||||
self.assertIsNotNone(traceback.tb_next.tb_next,
|
||||
'Should have more than the calling frame in the traceback.')
|
||||
|
||||
|
||||
@override_settings(INSTALLED_APPS=('utils_tests.test_module',))
|
||||
class AutodiscoverModulesTestCase(SimpleTestCase):
|
||||
|
||||
@@ -188,6 +190,7 @@ class ProxyFinder(object):
|
||||
if fd:
|
||||
fd.close()
|
||||
|
||||
|
||||
class TestFinder(object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.importer = zipimporter(*args, **kwargs)
|
||||
@@ -198,6 +201,7 @@ class TestFinder(object):
|
||||
return
|
||||
return TestLoader(importer)
|
||||
|
||||
|
||||
class TestLoader(object):
|
||||
def __init__(self, importer):
|
||||
self.importer = importer
|
||||
@@ -207,6 +211,7 @@ class TestLoader(object):
|
||||
mod.__loader__ = self
|
||||
return mod
|
||||
|
||||
|
||||
class CustomLoader(EggLoader):
|
||||
"""The Custom Loader test is exactly the same as the EggLoader, but
|
||||
it uses a custom defined Loader and Finder that is intentionally
|
||||
|
||||
Reference in New Issue
Block a user