|
@@ -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):
|
|
|
"""
|