summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatt Robenolt <matt@ydekproductions.com>2013-01-31 18:36:34 -0800
committerClaude Paroz <claude@2xlibre.net>2013-02-01 11:55:05 +0100
commit393c268e725f5b229ecb554f3fac02cfc250d2df (patch)
tree54691b840fb29a9a6fea7b126f48f3a1742132b5 /tests
parent56e553129f554f83c8e99ef3368544921dbd8a82 (diff)
Fixed #19715 -- Simplified findstatic output when verbosity set to 0
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/staticfiles_tests/tests.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/regressiontests/staticfiles_tests/tests.py b/tests/regressiontests/staticfiles_tests/tests.py
index 90c8621d0b..35d5683a0c 100644
--- a/tests/regressiontests/staticfiles_tests/tests.py
+++ b/tests/regressiontests/staticfiles_tests/tests.py
@@ -195,21 +195,33 @@ class TestFindStatic(CollectionTestCase, TestDefaults):
call_command('findstatic', filepath, all=False, verbosity=0, stdout=out)
out.seek(0)
lines = [l.strip() for l in out.readlines()]
- with codecs.open(force_text(lines[1].strip()), "r", "utf-8") as f:
+ with codecs.open(force_text(lines[0].strip()), "r", "utf-8") as f:
return f.read()
def test_all_files(self):
"""
- Test that findstatic returns all candidate files if run without --first.
+ Test that findstatic returns all candidate files if run without --first and -v1.
"""
out = six.StringIO()
- call_command('findstatic', 'test/file.txt', verbosity=0, stdout=out)
+ call_command('findstatic', 'test/file.txt', verbosity=1, stdout=out)
out.seek(0)
lines = [l.strip() for l in out.readlines()]
self.assertEqual(len(lines), 3) # three because there is also the "Found <file> here" line
self.assertIn('project', force_text(lines[1]))
self.assertIn('apps', force_text(lines[2]))
+ def test_all_files_less_verbose(self):
+ """
+ Test that findstatic returns all candidate files if run without --first and -v0.
+ """
+ out = six.StringIO()
+ call_command('findstatic', 'test/file.txt', verbosity=0, stdout=out)
+ out.seek(0)
+ lines = [l.strip() for l in out.readlines()]
+ self.assertEqual(len(lines), 2)
+ self.assertIn('project', force_text(lines[0]))
+ self.assertIn('apps', force_text(lines[1]))
+
class TestCollection(CollectionTestCase, TestDefaults):
"""