From 65cd74be8e99d06c7861edc5050e34d6444e4d56 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 19 Dec 2013 15:57:23 +0100 Subject: Stopped iterating on INSTALLED_APPS. Used the app cache's get_app_configs() method instead. --- tests/bash_completion/tests.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tests/bash_completion') diff --git a/tests/bash_completion/tests.py b/tests/bash_completion/tests.py index 6ff709809d..85fb58904c 100644 --- a/tests/bash_completion/tests.py +++ b/tests/bash_completion/tests.py @@ -5,7 +5,7 @@ import os import sys import unittest -from django.conf import settings +from django.core.apps import app_cache from django.core.management import ManagementUtility from django.utils.six import StringIO @@ -84,5 +84,7 @@ class BashCompletionTests(unittest.TestCase): "Application names will be autocompleted for an AppCommand" self._user_input('django-admin.py sqlall a') output = self._run_autocomplete() - app_labels = [name.split('.')[-1] for name in settings.INSTALLED_APPS] - self.assertEqual(output, sorted(label for label in app_labels if label.startswith('a'))) + a_labels = sorted(app_config.label + for app_config in app_cache.get_app_configs() + if app_config.label.startswith('a')) + self.assertEqual(output, a_labels) -- cgit v1.3