cookiecutter-django/tests/test_cookiecutter_substitution.py

34 lines
1.0 KiB
Python
Raw Normal View History

from __future__ import absolute_import
2015-04-20 15:19:12 +03:00
import sh
2015-03-27 16:56:55 +03:00
2015-04-20 15:19:12 +03:00
from .base import DjangoCookieTestCase
2015-03-27 16:56:55 +03:00
2015-04-20 15:19:12 +03:00
class TestCookiecutterSubstitution(DjangoCookieTestCase):
"""Test that all cookiecutter instances are substituted"""
2015-03-27 16:56:55 +03:00
def test_default_configuration(self):
2015-03-27 16:56:55 +03:00
# Build a list containing absolute paths to the generated files
2015-04-20 15:19:12 +03:00
paths = self.generate_project()
self.check_paths(paths)
2015-03-27 16:56:55 +03:00
def test_maildump_enabled(self):
paths = self.generate_project(extra_context={'use_maildump': 'y'})
self.check_paths(paths)
def test_celery_enabled(self):
paths = self.generate_project(extra_context={'use_celery': 'y'})
self.check_paths(paths)
def test_windows_enabled(self):
paths = self.generate_project(extra_context={'windows': 'y'})
self.check_paths(paths)
def test_flake8_compliance(self):
2015-04-20 15:19:12 +03:00
"""generated project should pass flake8"""
self.generate_project()
try:
sh.flake8(self.destpath)
except sh.ErrorReturnCode as e:
raise AssertionError(e)