mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #31528 -- Made collectstatic management command run staticfiles checks.
This commit is contained in:
parent
b23e3a1caa
commit
87faeee4e0
2 changed files with 14 additions and 0 deletions
|
@ -16,6 +16,7 @@ from django.contrib.staticfiles.management.commands import (
|
|||
)
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.core.management import CommandError, call_command
|
||||
from django.core.management.base import SystemCheckError
|
||||
from django.test import RequestFactory, override_settings
|
||||
from django.test.utils import extend_sys_path
|
||||
from django.utils import timezone
|
||||
|
@ -145,6 +146,12 @@ class TestConfiguration(StaticFilesTestCase):
|
|||
collectstatic.staticfiles_storage = staticfiles_storage
|
||||
storage.staticfiles_storage = staticfiles_storage
|
||||
|
||||
@override_settings(STATICFILES_DIRS=('test'))
|
||||
def test_collectstatis_check(self):
|
||||
msg = 'The STATICFILES_DIRS setting is not a tuple or list.'
|
||||
with self.assertRaisesMessage(SystemCheckError, msg):
|
||||
call_command('collectstatic', skip_checks=False)
|
||||
|
||||
|
||||
class TestCollectionHelpSubcommand(AdminScriptTestCase):
|
||||
@override_settings(STATIC_ROOT=None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue