diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-12-14 18:51:58 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-12-17 10:17:45 +0100 |
| commit | 5ba743e26230ef4c63069efc92c5844fd98995dc (patch) | |
| tree | ecbf852871744ffc77043bc6159f71e0a09d414f /tests | |
| parent | 69039becde74308d6218c72c1e410cd0049fd2bd (diff) | |
Made it possible to create apps without a models module.
This commit reverts f44c4a5d0f and 39bbd165.
django.test.simple will be updated in a separate commit as it requires
invasive changes.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/empty/no_models/tests.py | 6 | ||||
| -rw-r--r-- | tests/empty/tests.py | 20 | ||||
| -rw-r--r-- | tests/no_models/__init__.py | 0 | ||||
| -rw-r--r-- | tests/no_models/tests.py | 10 |
4 files changed, 10 insertions, 26 deletions
diff --git a/tests/empty/no_models/tests.py b/tests/empty/no_models/tests.py deleted file mode 100644 index 8b8db1af39..0000000000 --- a/tests/empty/no_models/tests.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.test import TestCase - - -class NoModelTests(TestCase): - """ A placeholder test case. See empty.tests for more info. """ - pass diff --git a/tests/empty/tests.py b/tests/empty/tests.py index 9fcd7a978e..7cebb87c2a 100644 --- a/tests/empty/tests.py +++ b/tests/empty/tests.py @@ -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') diff --git a/tests/no_models/__init__.py b/tests/no_models/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/no_models/__init__.py diff --git a/tests/no_models/tests.py b/tests/no_models/tests.py new file mode 100644 index 0000000000..f9ff80485e --- /dev/null +++ b/tests/no_models/tests.py @@ -0,0 +1,10 @@ +from django.apps import app_cache +from django.test import TestCase + + +class NoModelTests(TestCase): + + def test_no_models(self): + """Test that it's possible to load an app with no models.py file.""" + app_config = app_cache.get_app_config('no_models') + self.assertIsNone(app_config.models_module) |
