summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_scripts/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/admin_scripts/tests.py')
-rw-r--r--tests/regressiontests/admin_scripts/tests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py
index 17a2ccb194..e981f54c23 100644
--- a/tests/regressiontests/admin_scripts/tests.py
+++ b/tests/regressiontests/admin_scripts/tests.py
@@ -1489,3 +1489,21 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
self.assertNoOutput(err)
self.assertTrue(os.path.isdir(testproject_dir))
self.assertTrue(os.path.exists(os.path.join(testproject_dir, 'run.py')))
+
+ def test_file_without_extension(self):
+ "Make sure the startproject management command is able to render custom files"
+ template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template')
+ args = ['startproject', '--template', template_path, 'customtestproject', '-e', 'txt', '-n', 'Procfile']
+ testproject_dir = os.path.join(test_dir, 'customtestproject')
+
+ out, err = self.run_django_admin(args)
+ self.addCleanup(shutil.rmtree, testproject_dir)
+ self.assertNoOutput(err)
+ self.assertTrue(os.path.isdir(testproject_dir))
+ self.assertTrue(os.path.exists(os.path.join(testproject_dir, 'additional_dir')))
+ base_path = os.path.join(testproject_dir, 'additional_dir')
+ for f in ('Procfile', 'additional_file.py', 'requirements.txt'):
+ self.assertTrue(os.path.exists(os.path.join(base_path, f)))
+ with open(os.path.join(base_path, f)) as fh:
+ self.assertEqual(fh.read(),
+ '# some file for customtestproject test project')