Kaydet (Commit) 6e895f9e authored tarafından Aymeric Augustin's avatar Aymeric Augustin

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.
üst 4a56a93c
# Empty models.py to allow for specifying admindocs as a test label.
""" 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.
# Models module required so tests are discovered.
# This file intentionally left blank
# This file is required to pretend sitemaps has models.
# Otherwise test models cannot be registered.
# models.py file for tests to run.
# A models.py so that tests run.
# Remove this module when pre/post_migrate are refactored to use something
# other than a models module for their "sender" argument.
# Need a models module for the test runner.
......@@ -164,8 +164,7 @@ 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:
app_cache.load_app(module_label)
if module_label not in settings.INSTALLED_APPS:
settings.INSTALLED_APPS.append(module_label)
......
# models.py file for tests to run.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment