diff options
| author | Jannis Leidel <jannis@leidel.info> | 2012-02-04 13:01:30 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2012-02-04 13:01:30 +0000 |
| commit | faeee611d69717614424b6c3867cd5798ee25496 (patch) | |
| tree | b25f1fdf2e33a7d9c00c2c2be227ac3fc5f35ba6 /tests/regressiontests/admin_scripts/tests.py | |
| parent | bb6921ce888cfc981c4df8d5f079b0b7a4121ff6 (diff) | |
Fixed #17517 -- Added `--name` option to startproject and startapp management commands to be able to render files without a file extension. Thanks, Florian Apolloner.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17432 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_scripts/tests.py')
| -rw-r--r-- | tests/regressiontests/admin_scripts/tests.py | 18 |
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') |
