diff options
Diffstat (limited to 'tests/staticfiles_tests')
| -rw-r--r-- | tests/staticfiles_tests/test_liveserver.py | 7 | ||||
| -rw-r--r-- | tests/staticfiles_tests/tests.py | 11 |
2 files changed, 12 insertions, 6 deletions
diff --git a/tests/staticfiles_tests/test_liveserver.py b/tests/staticfiles_tests/test_liveserver.py index b7e309e1a7..e135ecfcf8 100644 --- a/tests/staticfiles_tests/test_liveserver.py +++ b/tests/staticfiles_tests/test_liveserver.py @@ -7,7 +7,7 @@ django.test.LiveServerTestCase. import os from django.core.exceptions import ImproperlyConfigured -from django.test import override_settings +from django.test import modify_settings, override_settings from django.utils.six.moves.urllib.request import urlopen from django.utils._os import upath @@ -86,12 +86,11 @@ class StaticLiveServerChecks(LiveServerBase): class StaticLiveServerView(LiveServerBase): - # The test is going to access a static file stored in this application. - available_apps = ['staticfiles_tests.apps.test'] - def urlopen(self, url): return urlopen(self.live_server_url + url) + # The test is going to access a static file stored in this application. + @modify_settings(INSTALLED_APPS={'append': 'staticfiles_tests.apps.test'}) def test_collectstatic_emulation(self): """ Test that StaticLiveServerCase use of staticfiles' serve() allows it to diff --git a/tests/staticfiles_tests/tests.py b/tests/staticfiles_tests/tests.py index df9a6ce3a2..ee6b28b3ce 100644 --- a/tests/staticfiles_tests/tests.py +++ b/tests/staticfiles_tests/tests.py @@ -41,6 +41,15 @@ TEST_SETTINGS = { 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'django.contrib.staticfiles.finders.DefaultStorageFinder', ), + 'INSTALLED_APPS': ( + 'django.contrib.contenttypes', + 'django.contrib.auth', + 'django.contrib.admin.apps.SimpleAdminConfig', + 'django.contrib.staticfiles', + 'staticfiles_tests', + 'staticfiles_tests.apps.test', + 'staticfiles_tests.apps.no_label', + ), } from django.contrib.staticfiles.management.commands.collectstatic import Command as CollectstaticCommand @@ -241,8 +250,6 @@ class TestFindStatic(CollectionTestCase, TestDefaults): searched_locations) self.assertIn(os.path.join('django', 'contrib', 'admin', 'static'), searched_locations) - self.assertIn(os.path.join('tests', 'servers', 'another_app', 'static'), - searched_locations) # FileSystemFinder searched locations self.assertIn(TEST_SETTINGS['STATICFILES_DIRS'][1][1], searched_locations) self.assertIn(TEST_SETTINGS['STATICFILES_DIRS'][0], searched_locations) |
