summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_scripts
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-12-29 17:03:38 +0000
committerRamiro Morales <cramm0@gmail.com>2011-12-29 17:03:38 +0000
commitf185024fc40d38fb4bcb9d3bb4a9b7a9e0f94219 (patch)
treee17378d28d870d675ff89f678984fb32218b6739 /tests/regressiontests/admin_scripts
parent3367913c3db97a15b64f03646ac2c4486a77376f (diff)
Made sure the new project template functionality works when the template
path specified has a trailing path separator. Thanks Alex for the report. Fixes #17475. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17287 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_scripts')
-rw-r--r--tests/regressiontests/admin_scripts/tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py
index 062e1a2c75..d33cfee83b 100644
--- a/tests/regressiontests/admin_scripts/tests.py
+++ b/tests/regressiontests/admin_scripts/tests.py
@@ -1414,6 +1414,18 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
self.assertTrue(os.path.isdir(testproject_dir))
self.assertTrue(os.path.exists(os.path.join(testproject_dir, 'additional_dir')))
+ def test_template_dir_with_trailing_slash(self):
+ "Ticket 17475: Template dir passed has a trailing path separator"
+ template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template' + os.sep)
+ args = ['startproject', '--template', template_path, 'customtestproject']
+ 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')))
+
def test_custom_project_template_from_tarball_by_path(self):
"Make sure the startproject management command is able to use a different project template from a tarball"
template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template.tgz')