diff options
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/staticfiles_tests/tests.py | 18 |
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): """ |
