diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2020-05-06 22:29:32 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-05-08 12:47:57 +0200 |
| commit | 87faeee4e0c0eb3937e2e575794f4512e513d214 (patch) | |
| tree | 26904ea93ddd2b305a24331937aea3b0e384bdee /tests/staticfiles_tests | |
| parent | b23e3a1caa10f824b6a0f8bbfaaab7fe53ac3abf (diff) | |
Fixed #31528 -- Made collectstatic management command run staticfiles checks.
Diffstat (limited to 'tests/staticfiles_tests')
| -rw-r--r-- | tests/staticfiles_tests/test_management.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/staticfiles_tests/test_management.py b/tests/staticfiles_tests/test_management.py index 1236d533d3..f249b63140 100644 --- a/tests/staticfiles_tests/test_management.py +++ b/tests/staticfiles_tests/test_management.py @@ -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) |
