From f185024fc40d38fb4bcb9d3bb4a9b7a9e0f94219 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Thu, 29 Dec 2011 17:03:38 +0000 Subject: 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 --- tests/regressiontests/admin_scripts/tests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/regressiontests/admin_scripts/tests.py') 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') -- cgit v1.3