Kaydet (Commit) 74d8fdcf authored tarafından Aymeric Augustin's avatar Aymeric Augustin

Stopped assuming that INSTALLED_APPS only contains app names.

While this assumption is true for the time being, it makes the code
needlessly brittle.
üst 4dc3be25
...@@ -167,11 +167,12 @@ def setup(verbosity, test_labels): ...@@ -167,11 +167,12 @@ def setup(verbosity, test_labels):
module_label == label or module_label.startswith(label + '.') module_label == label or module_label.startswith(label + '.')
for label in test_labels_set) for label in test_labels_set)
installed_app_names = set(get_installed())
if module_found_in_labels: if module_found_in_labels:
if verbosity >= 2: if verbosity >= 2:
print("Importing application %s" % module_name) print("Importing application %s" % module_name)
# HACK. # HACK.
if module_label not in settings.INSTALLED_APPS: if module_label not in installed_app_names:
settings.INSTALLED_APPS.append(module_label) settings.INSTALLED_APPS.append(module_label)
app_config = AppConfig.create(module_label) app_config = AppConfig.create(module_label)
apps.app_configs[app_config.label] = app_config apps.app_configs[app_config.label] = app_config
......
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