Refs #31180 -- Fixed unreachable assertions in apps tests.

This commit is contained in:
Mariusz Felisiak 2020-08-11 10:31:09 +02:00 committed by GitHub
parent 804f2b7024
commit 287e36bd22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 4 deletions

View File

@ -501,8 +501,13 @@ class DeprecationTests(SimpleTestCase):
) )
with self.assertRaisesMessage(RemovedInDjango41Warning, msg): with self.assertRaisesMessage(RemovedInDjango41Warning, msg):
with self.settings(INSTALLED_APPS=['apps.explicit_default_config_app']): with self.settings(INSTALLED_APPS=['apps.explicit_default_config_app']):
config = apps.get_app_config('explicit_default_config_app') pass
self.assertIsInstance(config, ExplicitDefaultConfig) with ignore_warnings(category=RemovedInDjango41Warning):
with self.settings(INSTALLED_APPS=['apps.explicit_default_config_app']):
self.assertIsInstance(
apps.get_app_config('explicit_default_config_app'),
ExplicitDefaultConfig,
)
def test_explicit_default_app_config_mismatch(self): def test_explicit_default_app_config_mismatch(self):
""" """
@ -522,8 +527,13 @@ class DeprecationTests(SimpleTestCase):
) )
with self.assertRaisesMessage(RemovedInDjango41Warning, msg): with self.assertRaisesMessage(RemovedInDjango41Warning, msg):
with self.settings(INSTALLED_APPS=['apps.explicit_default_config_mismatch_app']): with self.settings(INSTALLED_APPS=['apps.explicit_default_config_mismatch_app']):
config = apps.get_app_config('explicit_default_config_mismatch_app') pass
self.assertIsInstance(config, ExplicitDefaultConfigMismatch) with ignore_warnings(category=RemovedInDjango41Warning):
with self.settings(INSTALLED_APPS=['apps.explicit_default_config_mismatch_app']):
self.assertIsInstance(
apps.get_app_config('explicit_default_config_mismatch_app'),
ExplicitDefaultConfigMismatch,
)
def test_explicit_default_app_config_empty_apps(self): def test_explicit_default_app_config_empty_apps(self):
""" """