From 19b490820678cc8a5d0bd068127e425178799e34 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 24 May 2014 10:53:22 +0200 Subject: [PATCH] Made runtests.py use 'set_installed_apps' API This will also trigger the ready method of any tested application, which was not run before. --- tests/runtests.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/runtests.py b/tests/runtests.py index 14014f4b01..4956832a5b 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -143,6 +143,7 @@ def setup(verbosity, test_labels): bits = bits[:1] test_labels_set.add('.'.join(bits)) + installed_app_names = set(get_installed()) for modpath, module_name in test_modules: if modpath: module_label = '.'.join([modpath, module_name]) @@ -159,16 +160,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 and module_label not in installed_app_names: if verbosity >= 2: print("Importing application %s" % module_name) - # HACK. settings.INSTALLED_APPS.append(module_label) - app_config = AppConfig.create(module_label) - apps.app_configs[app_config.label] = app_config - app_config.import_models(apps.all_models[app_config.label]) - apps.clear_cache() + + apps.set_installed_apps(settings.INSTALLED_APPS) return state