瀏覽代碼

Removed superfluous models.py files.

Added comments in the three empty models.py files that are still needed.

Adjusted the test runner to add applications corresponding to test
labels to INSTALLED_APPS even when they don't have a models module.
Aymeric Augustin 11 年之前
父節點
當前提交
6e895f9e06
共有 50 個文件被更改,包括 9 次插入16 次删除
  1. 0 1
      django/contrib/admindocs/models.py
  2. 2 1
      django/contrib/formtools/models.py
  3. 0 0
      django/contrib/humanize/models.py
  4. 0 1
      django/contrib/messages/models.py
  5. 2 1
      django/contrib/sitemaps/models.py
  6. 0 0
      django/contrib/staticfiles/models.py
  7. 0 0
      django/contrib/webdesign/models.py
  8. 0 0
      tests/admin_docs/models.py
  9. 0 1
      tests/admin_scripts/custom_templates/app_template/models.py
  10. 0 0
      tests/app_loading/models.py
  11. 0 0
      tests/bash_completion/models.py
  12. 0 0
      tests/builtin_server/models.py
  13. 0 0
      tests/conditional_processing/models.py
  14. 0 1
      tests/context_processors/models.py
  15. 0 0
      tests/createsuperuser/models.py
  16. 0 1
      tests/csrf_tests/models.py
  17. 0 0
      tests/db_typecasts/models.py
  18. 0 1
      tests/decorators/models.py
  19. 0 0
      tests/defaultfilters/models.py
  20. 0 0
      tests/deprecation/models.py
  21. 0 0
      tests/dispatch/models.py
  22. 0 0
      tests/field_deconstruction/models.py
  23. 0 0
      tests/files/models.py
  24. 0 0
      tests/handlers/models.py
  25. 0 0
      tests/http_utils/models.py
  26. 0 0
      tests/httpwrappers/models.py
  27. 0 1
      tests/i18n/resolution/models.py
  28. 0 0
      tests/invalid_models/models.py
  29. 0 0
      tests/logging_tests/models.py
  30. 0 0
      tests/middleware_exceptions/models.py
  31. 2 0
      tests/migrate_signals/models.py
  32. 0 0
      tests/migrations/migrations_test_apps/normal/models.py
  33. 0 1
      tests/requests/models.py
  34. 0 0
      tests/responses/models.py
  35. 3 4
      tests/runtests.py
  36. 0 0
      tests/servers/another_app/models.py
  37. 0 1
      tests/signed_cookies_tests/models.py
  38. 0 1
      tests/signing/models.py
  39. 0 0
      tests/staticfiles_tests/apps/no_label/models.py
  40. 0 0
      tests/staticfiles_tests/apps/test/models.py
  41. 0 0
      tests/staticfiles_tests/models.py
  42. 0 0
      tests/template_tests/models.py
  43. 0 0
      tests/test_client/models.py
  44. 0 0
      tests/test_runner_deprecation_app/models.py
  45. 0 0
      tests/test_suite_override/models.py
  46. 0 0
      tests/text/models.py
  47. 0 0
      tests/urlpatterns_reverse/models.py
  48. 0 0
      tests/validators/models.py
  49. 0 0
      tests/version/models.py
  50. 0 0
      tests/wsgi/models.py

+ 0 - 1
django/contrib/admindocs/models.py

@@ -1 +0,0 @@
-# Empty models.py to allow for specifying admindocs as a test label.

+ 2 - 1
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.

+ 0 - 0
django/contrib/humanize/models.py


+ 0 - 1
django/contrib/messages/models.py

@@ -1 +0,0 @@
-# Models module required so tests are discovered.

+ 2 - 1
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.

+ 0 - 0
django/contrib/staticfiles/models.py


+ 0 - 0
django/contrib/webdesign/models.py


+ 0 - 0
tests/admin_docs/models.py


+ 0 - 1
tests/admin_scripts/custom_templates/app_template/models.py

@@ -1 +0,0 @@
-# whatever

+ 0 - 0
tests/app_loading/models.py


+ 0 - 0
tests/bash_completion/models.py


+ 0 - 0
tests/builtin_server/models.py


+ 0 - 0
tests/conditional_processing/models.py


+ 0 - 1
tests/context_processors/models.py

@@ -1 +0,0 @@
-# Models file for tests to run.

+ 0 - 0
tests/createsuperuser/models.py


+ 0 - 1
tests/csrf_tests/models.py

@@ -1 +0,0 @@
-# models.py file for tests to run.

+ 0 - 0
tests/db_typecasts/models.py


+ 0 - 1
tests/decorators/models.py

@@ -1 +0,0 @@
-# A models.py so that tests run.

+ 0 - 0
tests/defaultfilters/models.py


+ 0 - 0
tests/deprecation/models.py


+ 0 - 0
tests/dispatch/models.py


+ 0 - 0
tests/field_deconstruction/models.py


+ 0 - 0
tests/files/models.py


+ 0 - 0
tests/handlers/models.py


+ 0 - 0
tests/http_utils/models.py


+ 0 - 0
tests/httpwrappers/models.py


+ 0 - 1
tests/i18n/resolution/models.py

@@ -1 +0,0 @@
-#

+ 0 - 0
tests/invalid_models/models.py


+ 0 - 0
tests/logging_tests/models.py


+ 0 - 0
tests/middleware_exceptions/models.py


+ 2 - 0
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.

+ 0 - 0
tests/migrations/migrations_test_apps/normal/models.py


+ 0 - 1
tests/requests/models.py

@@ -1 +0,0 @@
-# Need a models module for the test runner.

+ 0 - 0
tests/responses/models.py


+ 3 - 4
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
 

+ 0 - 0
tests/servers/another_app/models.py


+ 0 - 1
tests/signed_cookies_tests/models.py

@@ -1 +0,0 @@
-# models.py file for tests to run.

+ 0 - 1
tests/signing/models.py

@@ -1 +0,0 @@
-# models.py file for tests to run.

+ 0 - 0
tests/staticfiles_tests/apps/no_label/models.py


+ 0 - 0
tests/staticfiles_tests/apps/test/models.py


+ 0 - 0
tests/staticfiles_tests/models.py


+ 0 - 0
tests/template_tests/models.py


+ 0 - 0
tests/test_client/models.py


+ 0 - 0
tests/test_runner_deprecation_app/models.py


+ 0 - 0
tests/test_suite_override/models.py


+ 0 - 0
tests/text/models.py


+ 0 - 0
tests/urlpatterns_reverse/models.py


+ 0 - 0
tests/validators/models.py


+ 0 - 0
tests/version/models.py


+ 0 - 0
tests/wsgi/models.py