Explicitly close files in the staticfiles tests.
This commit is contained in:
parent
20a7a244d7
commit
2048bbee8c
|
@ -197,9 +197,8 @@ class TestFindStatic(CollectionTestCase, TestDefaults):
|
||||||
call_command('findstatic', filepath, all=False, verbosity=0, stdout=out)
|
call_command('findstatic', filepath, all=False, verbosity=0, stdout=out)
|
||||||
out.seek(0)
|
out.seek(0)
|
||||||
lines = [l.strip() for l in out.readlines()]
|
lines = [l.strip() for l in out.readlines()]
|
||||||
contents = codecs.open(
|
with codecs.open(smart_text(lines[1].strip()), "r", "utf-8") as f:
|
||||||
smart_text(lines[1].strip()), "r", "utf-8").read()
|
return f.read()
|
||||||
return contents
|
|
||||||
|
|
||||||
def test_all_files(self):
|
def test_all_files(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue