Fix test failure due to favicon.ico being opened by DjangoCookieTestCase.check_paths().

This commit is contained in:
Audrey Roy Greenfeld 2015-11-06 19:44:10 -08:00
parent 1c1ca39618
commit 7e8f58d6ec
2 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,7 @@
cookiecutter==1.2.1 cookiecutter==1.2.1
flake8==2.5.0 flake8==2.5.0
sh sh
binaryornot==0.4.0
# Debugging # Debugging
# ------------------------------------- # -------------------------------------

View File

@ -4,6 +4,7 @@ import shutil
import unittest import unittest
from os.path import exists, dirname, join from os.path import exists, dirname, join
from binaryornot.check import is_binary
import sh import sh
from cookiecutter.main import cookiecutter from cookiecutter.main import cookiecutter
@ -26,11 +27,12 @@ class DjangoCookieTestCase(unittest.TestCase):
# Assert that no match is found in any of the files # Assert that no match is found in any of the files
for path in paths: for path in paths:
for line in open(path, 'r'): if not is_binary(path):
match = re_obj.search(line) for line in open(path, 'r'):
self.assertIsNone( match = re_obj.search(line)
match, self.assertIsNone(
"cookiecutter variable not replaced in {}".format(path)) match,
"cookiecutter variable not replaced in {}".format(path))
def generate_project(self, extra_context=None): def generate_project(self, extra_context=None):
ctx = { ctx = {