diff options
| author | Loic Bistuer <loic.bistuer@sixmedia.com> | 2013-12-10 00:29:39 +0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-12-31 14:58:49 -0500 |
| commit | 4befb3015c26810a68cfcf57e0cd8b062f56f1c5 (patch) | |
| tree | 52909117010247223190bf2112bcaf7b0926d3f2 /tests/staticfiles_tests | |
| parent | 4d8d76e7a89858932b6f4f280a0ebf4cf94ab4b7 (diff) | |
Fixed #21581 -- Fixed a number of issues with collectstatic.
When STATIC_ROOT wasn't set, collectstatic --clear would delete
every files within the current directory and its descendants.
This patch makes the following changes:
Prevent collectstatic from running if STATIC_ROOT isn't set.
Fixed an issue that prevented collectstatic from displaying the
destination directory.
Changed the warning header to notify when the command is run
in dry-run mode.
Diffstat (limited to 'tests/staticfiles_tests')
| -rw-r--r-- | tests/staticfiles_tests/tests.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/staticfiles_tests/tests.py b/tests/staticfiles_tests/tests.py index 19c244e353..1de9f9ed84 100644 --- a/tests/staticfiles_tests/tests.py +++ b/tests/staticfiles_tests/tests.py @@ -224,6 +224,17 @@ class TestFindStatic(CollectionTestCase, TestDefaults): self.assertIn('apps', force_text(lines[1])) +class TestConfiguration(StaticFilesTestCase): + def test_location_empty(self): + err = six.StringIO() + for root in ['', None]: + with override_settings(STATIC_ROOT=root): + with six.assertRaisesRegex( + self, ImproperlyConfigured, + 'without having set the STATIC_ROOT setting to a filesystem path'): + call_command('collectstatic', interactive=False, verbosity=0, stderr=err) + + class TestCollection(CollectionTestCase, TestDefaults): """ Test ``collectstatic`` management command. |
