diff options
| author | Alex Morozov <inductor2000@mail.ru> | 2015-11-20 23:59:34 +0300 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2015-11-22 20:32:14 +0100 |
| commit | 6ca163d7cc451fafd3015fa2ee735d5377fa3065 (patch) | |
| tree | f27e139dce046ff1d0ed59662a7793c94e60d88d /tests/staticfiles_tests/test_management.py | |
| parent | 550107ff756beeb17b465e98c26c59e3dcc5eb3e (diff) | |
Fixed #25784 -- Prevented an exception on collectstatic help
Made the `manage.py help collectstatic` don't fail if the `STATIC_ROOT`
setting is empty.
Diffstat (limited to 'tests/staticfiles_tests/test_management.py')
| -rw-r--r-- | tests/staticfiles_tests/test_management.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/staticfiles_tests/test_management.py b/tests/staticfiles_tests/test_management.py index 94166f9888..7c1c4223d0 100644 --- a/tests/staticfiles_tests/test_management.py +++ b/tests/staticfiles_tests/test_management.py @@ -6,6 +6,8 @@ import shutil import tempfile import unittest +from admin_scripts.tests import AdminScriptTestCase + from django.conf import settings from django.contrib.staticfiles import storage from django.contrib.staticfiles.management.commands import collectstatic @@ -130,6 +132,18 @@ class TestConfiguration(StaticFilesTestCase): storage.staticfiles_storage = staticfiles_storage +class TestCollectionHelpSubcommand(AdminScriptTestCase): + @override_settings(STATIC_ROOT=None) + def test_missing_settings_dont_prevent_help(self): + """ + Even if the STATIC_ROOT setting is not set, one can still call the + `manage.py help collectstatic` command. + """ + self.write_settings('settings.py', apps=['django.contrib.staticfiles']) + out, err = self.run_manage(['help', 'collectstatic']) + self.assertNoOutput(err) + + class TestCollection(CollectionTestCase, TestDefaults): """ Test ``collectstatic`` management command. |
