diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/admin_scripts/custom_templates/project_template/manage.py-tpl (renamed from tests/admin_scripts/custom_templates/project_template/manage.py) | 0 | ||||
| -rw-r--r-- | tests/admin_scripts/tests.py | 2 | ||||
| -rw-r--r-- | tests/project_template/test_settings.py | 15 |
3 files changed, 16 insertions, 1 deletions
diff --git a/tests/admin_scripts/custom_templates/project_template/manage.py b/tests/admin_scripts/custom_templates/project_template/manage.py-tpl index d9843c433f..d9843c433f 100755 --- a/tests/admin_scripts/custom_templates/project_template/manage.py +++ b/tests/admin_scripts/custom_templates/project_template/manage.py-tpl diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 805be8b144..60c3a68fd2 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -181,7 +181,7 @@ class AdminScriptTestCase(unittest.TestCase): pass conf_dir = os.path.dirname(upath(conf.__file__)) - template_manage_py = os.path.join(conf_dir, 'project_template', 'manage.py') + template_manage_py = os.path.join(conf_dir, 'project_template', 'manage.py-tpl') test_manage_py = os.path.join(self.test_dir, 'manage.py') shutil.copyfile(template_manage_py, test_manage_py) diff --git a/tests/project_template/test_settings.py b/tests/project_template/test_settings.py index ac115f7dc2..25a95717a9 100644 --- a/tests/project_template/test_settings.py +++ b/tests/project_template/test_settings.py @@ -1,13 +1,28 @@ +import os +import shutil import unittest +from django import conf from django.test import TestCase from django.utils import six +from django.utils._os import upath @unittest.skipIf(six.PY2, 'Python 2 cannot import the project template because ' 'django/conf/project_template doesn\'t have an __init__.py file.') class TestStartProjectSettings(TestCase): + def setUp(self): + # Ensure settings.py exists + project_dir = os.path.join( + os.path.dirname(upath(conf.__file__)), + 'project_template', + 'project_name', + ) + template_settings_py = os.path.join(project_dir, 'settings.py-tpl') + test_settings_py = os.path.join(project_dir, 'settings.py') + shutil.copyfile(template_settings_py, test_settings_py) + self.addCleanup(os.remove, test_settings_py) def test_middleware_classes_headers(self): """ |
