diff --git a/django/contrib/admindocs/models.py b/django/contrib/admindocs/models.py deleted file mode 100644 index a9f813a4cb..0000000000 --- a/django/contrib/admindocs/models.py +++ /dev/null @@ -1 +0,0 @@ -# Empty models.py to allow for specifying admindocs as a test label. diff --git a/django/contrib/formtools/models.py b/django/contrib/formtools/models.py index 13990e24af..8a90059b9d 100644 --- a/django/contrib/formtools/models.py +++ b/django/contrib/formtools/models.py @@ -1 +1,2 @@ -""" models.py (even empty) currently required by the runtests.py to enable unit tests """ +# This file is required to pretend formtools has models. +# Otherwise test models cannot be registered. diff --git a/django/contrib/humanize/models.py b/django/contrib/humanize/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/django/contrib/messages/models.py b/django/contrib/messages/models.py deleted file mode 100644 index 4f656f5082..0000000000 --- a/django/contrib/messages/models.py +++ /dev/null @@ -1 +0,0 @@ -# Models module required so tests are discovered. diff --git a/django/contrib/sitemaps/models.py b/django/contrib/sitemaps/models.py index 6e7633bfe0..9ade3254cc 100644 --- a/django/contrib/sitemaps/models.py +++ b/django/contrib/sitemaps/models.py @@ -1 +1,2 @@ -# This file intentionally left blank +# This file is required to pretend sitemaps has models. +# Otherwise test models cannot be registered. diff --git a/django/contrib/staticfiles/models.py b/django/contrib/staticfiles/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/django/contrib/webdesign/models.py b/django/contrib/webdesign/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/admin_docs/models.py b/tests/admin_docs/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/admin_scripts/custom_templates/app_template/models.py b/tests/admin_scripts/custom_templates/app_template/models.py deleted file mode 100644 index fcd0b215d8..0000000000 --- a/tests/admin_scripts/custom_templates/app_template/models.py +++ /dev/null @@ -1 +0,0 @@ -# whatever diff --git a/tests/app_loading/models.py b/tests/app_loading/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/bash_completion/models.py b/tests/bash_completion/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/builtin_server/models.py b/tests/builtin_server/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/conditional_processing/models.py b/tests/conditional_processing/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/context_processors/models.py b/tests/context_processors/models.py deleted file mode 100644 index cde172db68..0000000000 --- a/tests/context_processors/models.py +++ /dev/null @@ -1 +0,0 @@ -# Models file for tests to run. diff --git a/tests/createsuperuser/models.py b/tests/createsuperuser/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/csrf_tests/models.py b/tests/csrf_tests/models.py deleted file mode 100644 index 71abcc5198..0000000000 --- a/tests/csrf_tests/models.py +++ /dev/null @@ -1 +0,0 @@ -# models.py file for tests to run. diff --git a/tests/db_typecasts/models.py b/tests/db_typecasts/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/decorators/models.py b/tests/decorators/models.py deleted file mode 100644 index 22e41b9828..0000000000 --- a/tests/decorators/models.py +++ /dev/null @@ -1 +0,0 @@ -# A models.py so that tests run. diff --git a/tests/defaultfilters/models.py b/tests/defaultfilters/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/deprecation/models.py b/tests/deprecation/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/dispatch/models.py b/tests/dispatch/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/field_deconstruction/models.py b/tests/field_deconstruction/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/files/models.py b/tests/files/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/handlers/models.py b/tests/handlers/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/http_utils/models.py b/tests/http_utils/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/httpwrappers/models.py b/tests/httpwrappers/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/i18n/resolution/models.py b/tests/i18n/resolution/models.py deleted file mode 100644 index 792d600548..0000000000 --- a/tests/i18n/resolution/models.py +++ /dev/null @@ -1 +0,0 @@ -# diff --git a/tests/invalid_models/models.py b/tests/invalid_models/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/logging_tests/models.py b/tests/logging_tests/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/middleware_exceptions/models.py b/tests/middleware_exceptions/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/migrate_signals/models.py b/tests/migrate_signals/models.py index e69de29bb2..55a8657a3c 100644 --- a/tests/migrate_signals/models.py +++ b/tests/migrate_signals/models.py @@ -0,0 +1,2 @@ +# Remove this module when pre/post_migrate are refactored to use something +# other than a models module for their "sender" argument. diff --git a/tests/migrations/migrations_test_apps/normal/models.py b/tests/migrations/migrations_test_apps/normal/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/requests/models.py b/tests/requests/models.py deleted file mode 100644 index 19f81d601a..0000000000 --- a/tests/requests/models.py +++ /dev/null @@ -1 +0,0 @@ -# Need a models module for the test runner. diff --git a/tests/responses/models.py b/tests/responses/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/runtests.py b/tests/runtests.py index d5b94064d5..badbd6fbec 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -164,10 +164,9 @@ def setup(verbosity, test_labels): if module_found_in_labels: if verbosity >= 2: print("Importing application %s" % module_name) - mod = app_cache.load_app(module_label) - if mod: - if module_label not in settings.INSTALLED_APPS: - settings.INSTALLED_APPS.append(module_label) + app_cache.load_app(module_label) + if module_label not in settings.INSTALLED_APPS: + settings.INSTALLED_APPS.append(module_label) return state diff --git a/tests/servers/another_app/models.py b/tests/servers/another_app/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/signed_cookies_tests/models.py b/tests/signed_cookies_tests/models.py deleted file mode 100644 index 71abcc5198..0000000000 --- a/tests/signed_cookies_tests/models.py +++ /dev/null @@ -1 +0,0 @@ -# models.py file for tests to run. diff --git a/tests/signing/models.py b/tests/signing/models.py deleted file mode 100644 index 71abcc5198..0000000000 --- a/tests/signing/models.py +++ /dev/null @@ -1 +0,0 @@ -# models.py file for tests to run. diff --git a/tests/staticfiles_tests/apps/no_label/models.py b/tests/staticfiles_tests/apps/no_label/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/staticfiles_tests/apps/test/models.py b/tests/staticfiles_tests/apps/test/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/staticfiles_tests/models.py b/tests/staticfiles_tests/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/template_tests/models.py b/tests/template_tests/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/test_client/models.py b/tests/test_client/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/test_runner_deprecation_app/models.py b/tests/test_runner_deprecation_app/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/test_suite_override/models.py b/tests/test_suite_override/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/text/models.py b/tests/text/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/urlpatterns_reverse/models.py b/tests/urlpatterns_reverse/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/validators/models.py b/tests/validators/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/version/models.py b/tests/version/models.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/wsgi/models.py b/tests/wsgi/models.py deleted file mode 100644 index e69de29bb2..0000000000