summaryrefslogtreecommitdiff
path: root/tests/bash_completion
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-19 15:57:23 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-22 11:39:18 +0100
commit65cd74be8e99d06c7861edc5050e34d6444e4d56 (patch)
tree72431d2a70af3d235543781fadce8e647c746959 /tests/bash_completion
parentd4733b6df07b1f8a869eed8eac86869d1d14472c (diff)
downloaddjango-65cd74be8e99d06c7861edc5050e34d6444e4d56.tar.gz
Stopped iterating on INSTALLED_APPS.
Used the app cache's get_app_configs() method instead.
Diffstat (limited to 'tests/bash_completion')
-rw-r--r--tests/bash_completion/tests.py8
1 files changed, 5 insertions, 3 deletions
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)