summaryrefslogtreecommitdiff
path: root/tests/bash_completion/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bash_completion/tests.py')
-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)