mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Made it possible to create apps without a models module.
This commit revertsf44c4a5d0fand39bbd165. django.test.simple will be updated in a separate commit as it requires invasive changes.
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
from django.apps import app_cache
|
||||
from django.test import TestCase
|
||||
from django.test.utils import override_settings
|
||||
from django.utils import six
|
||||
|
||||
from .models import Empty
|
||||
|
||||
@@ -16,20 +13,3 @@ class EmptyModelTests(TestCase):
|
||||
self.assertTrue(m.id is not None)
|
||||
existing = Empty(m.id)
|
||||
existing.save()
|
||||
|
||||
|
||||
class NoModelTests(TestCase):
|
||||
"""
|
||||
Test for #7198 to ensure that the proper error message is raised
|
||||
when attempting to load an app with no models.py file.
|
||||
|
||||
Because the test runner won't currently load a test module with no
|
||||
models.py file, this TestCase instead lives in this module.
|
||||
|
||||
It seemed like an appropriate home for it.
|
||||
"""
|
||||
@override_settings(INSTALLED_APPS=("empty.no_models",))
|
||||
def test_no_models(self):
|
||||
with six.assertRaisesRegex(self, LookupError,
|
||||
"No app with label 'no_models'."):
|
||||
app_cache.get_app_config('no_models')
|
||||
|
||||
Reference in New Issue
Block a user