mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #24971 -- Made startapp generate an apps.py
This commit is contained in:
committed by
Tim Graham
parent
c5eca74619
commit
e6dd7f995a
@@ -592,6 +592,14 @@ class DjangoAdminSettingsDirectory(AdminScriptTestCase):
|
||||
self.addCleanup(shutil.rmtree, app_path)
|
||||
self.assertNoOutput(err)
|
||||
self.assertTrue(os.path.exists(app_path))
|
||||
with open(os.path.join(app_path, 'apps.py'), 'r') as f:
|
||||
content = f.read()
|
||||
self.assertIn("class SettingsTestConfig(AppConfig)", content)
|
||||
self.assertIn("name = 'settings_test'", content)
|
||||
with open(os.path.join(app_path, '__init__.py'), 'r') as f:
|
||||
content = f.read()
|
||||
expected_content = "default_app_config = 'settings_test.apps.SettingsTestConfig'"
|
||||
self.assertIn(expected_content, content)
|
||||
if not PY3:
|
||||
with open(os.path.join(app_path, 'models.py'), 'r') as fp:
|
||||
content = fp.read()
|
||||
|
||||
Reference in New Issue
Block a user