Commit 74d8fdcf authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

Stopped assuming that INSTALLED_APPS only contains app names.

While this assumption is true for the time being, it makes the code
needlessly brittle.
parent 4dc3be25
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -167,11 +167,12 @@ def setup(verbosity, test_labels):
                module_label == label or module_label.startswith(label + '.')
                for label in test_labels_set)

        installed_app_names = set(get_installed())
        if module_found_in_labels:
            if verbosity >= 2:
                print("Importing application %s" % module_name)
            # HACK.
            if module_label not in settings.INSTALLED_APPS:
            if module_label not in installed_app_names:
                settings.INSTALLED_APPS.append(module_label)
            app_config = AppConfig.create(module_label)
            apps.app_configs[app_config.label] = app_config