mirror of
https://github.com/django/django.git
synced 2025-12-10 03:10:10 +00:00
Added the ability to supply custom app configs.
This commit is contained in:
parent
517c24bcfa
commit
99bd39ef6e
3 changed files with 69 additions and 20 deletions
|
|
@ -226,7 +226,7 @@ class ModulesTestsPackages(IgnoreAllDeprecationWarningsMixin, unittest.TestCase)
|
|||
"Check that the get_tests helper function can find tests in a directory"
|
||||
from django.core.apps.base import AppConfig
|
||||
from django.test.simple import get_tests
|
||||
app_config = AppConfig('test_runner.valid_app')
|
||||
app_config = AppConfig.create('test_runner.valid_app')
|
||||
app_config.import_models({})
|
||||
tests = get_tests(app_config)
|
||||
self.assertIsInstance(tests, types.ModuleType)
|
||||
|
|
@ -235,7 +235,7 @@ class ModulesTestsPackages(IgnoreAllDeprecationWarningsMixin, unittest.TestCase)
|
|||
"Test for #12658 - Tests with ImportError's shouldn't fail silently"
|
||||
from django.core.apps.base import AppConfig
|
||||
from django.test.simple import get_tests
|
||||
app_config = AppConfig('test_runner_invalid_app')
|
||||
app_config = AppConfig.create('test_runner_invalid_app')
|
||||
app_config.import_models({})
|
||||
with self.assertRaises(ImportError):
|
||||
get_tests(app_config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue