|
@@ -164,6 +164,31 @@ class TestCollection(TestDefaults, CollectionTestCase):
|
|
|
self.assertFileNotFound('test/CVS')
|
|
|
|
|
|
|
|
|
+class TestCollectionVerbosity(CollectionTestCase):
|
|
|
+ copying_msg = 'Copying '
|
|
|
+ run_collectstatic_in_setUp = False
|
|
|
+ staticfiles_copied_msg = 'static files copied to'
|
|
|
+
|
|
|
+ def test_verbosity_0(self):
|
|
|
+ stdout = StringIO()
|
|
|
+ self.run_collectstatic(verbosity=0, stdout=stdout)
|
|
|
+ self.assertEqual(stdout.getvalue(), '')
|
|
|
+
|
|
|
+ def test_verbosity_1(self):
|
|
|
+ stdout = StringIO()
|
|
|
+ self.run_collectstatic(verbosity=1, stdout=stdout)
|
|
|
+ output = stdout.getvalue()
|
|
|
+ self.assertIn(self.staticfiles_copied_msg, output)
|
|
|
+ self.assertNotIn(self.copying_msg, output)
|
|
|
+
|
|
|
+ def test_verbosity_2(self):
|
|
|
+ stdout = StringIO()
|
|
|
+ self.run_collectstatic(verbosity=2, stdout=stdout)
|
|
|
+ output = stdout.getvalue()
|
|
|
+ self.assertIn(self.staticfiles_copied_msg, output)
|
|
|
+ self.assertIn(self.copying_msg, output)
|
|
|
+
|
|
|
+
|
|
|
class TestCollectionClear(CollectionTestCase):
|
|
|
"""
|
|
|
Test the ``--clear`` option of the ``collectstatic`` management command.
|