Skip to content

Commit

Permalink
Fix test failure due to favicon.ico being opened by DjangoCookieTestC…
Browse files Browse the repository at this point in the history
…ase.check_paths().
  • Loading branch information
audreyfeldroy committed Nov 7, 2015
1 parent 1c1ca39 commit 7e8f58d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cookiecutter==1.2.1
flake8==2.5.0
sh
binaryornot==0.4.0

# Debugging
# -------------------------------------
Expand Down
12 changes: 7 additions & 5 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import unittest
from os.path import exists, dirname, join

from binaryornot.check import is_binary
import sh

from cookiecutter.main import cookiecutter
Expand All @@ -26,11 +27,12 @@ def check_paths(self, paths):

# Assert that no match is found in any of the files
for path in paths:
for line in open(path, 'r'):
match = re_obj.search(line)
self.assertIsNone(
match,
"cookiecutter variable not replaced in {}".format(path))
if not is_binary(path):
for line in open(path, 'r'):
match = re_obj.search(line)
self.assertIsNone(
match,
"cookiecutter variable not replaced in {}".format(path))

def generate_project(self, extra_context=None):
ctx = {
Expand Down

0 comments on commit 7e8f58d

Please sign in to comment.