2015-07-29 00:17:28 +03:00
|
|
|
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
|
|
|
|
2015-07-29 00:17:28 +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()
|
2015-07-29 00:11:06 +03:00
|
|
|
self.check_paths(paths)
|
2015-03-27 16:56:55 +03:00
|
|
|
|
2015-07-29 00:17:28 +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)
|