summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_scripts
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2012-01-04 23:55:34 +0000
committerCarl Meyer <carl@oddbird.net>2012-01-04 23:55:34 +0000
commitbc63ba700a0ae3ba435c267789d8c2e3931016df (patch)
tree1d278fa48dd5e52b65e6bc16a36d33514e9b7b1a /tests/regressiontests/admin_scripts
parent8e9043bccbe18d4b6d1550bffeff4c28e5135f6c (diff)
Fixed #17503 -- A destination directory passed to startproject or startapp as optional second argument is now reused as the project/app directory, rather than a new project/app directory created within it. Refs #17042.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17340 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_scripts')
-rw-r--r--tests/regressiontests/admin_scripts/tests.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py
index f896817eab..948eb3a659 100644
--- a/tests/regressiontests/admin_scripts/tests.py
+++ b/tests/regressiontests/admin_scripts/tests.py
@@ -1404,17 +1404,17 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
"Make sure the startproject management command creates a project in a specific directory"
args = ['startproject', 'testproject', 'othertestproject']
testproject_dir = os.path.join(test_dir, 'othertestproject')
+ os.mkdir(testproject_dir)
out, err = self.run_django_admin(args)
self.addCleanup(shutil.rmtree, testproject_dir)
self.assertNoOutput(err)
- self.assertTrue(os.path.isdir(os.path.join(testproject_dir, 'testproject')))
- self.assertTrue(os.path.exists(os.path.join(testproject_dir, 'testproject', 'manage.py')))
+ self.assertTrue(os.path.exists(os.path.join(testproject_dir, 'manage.py')))
# running again..
out, err = self.run_django_admin(args)
self.assertNoOutput(out)
- self.assertOutput(err, "File exists")
+ self.assertOutput(err, "already exists")
def test_custom_project_template(self):
"Make sure the startproject management command is able to use a different project template"
@@ -1452,6 +1452,19 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
self.assertTrue(os.path.isdir(testproject_dir))
self.assertTrue(os.path.exists(os.path.join(testproject_dir, 'run.py')))
+ def test_custom_project_template_from_tarball_to_alternative_location(self):
+ "Startproject can use a project template from a tarball and create it in a specified location"
+ template_path = os.path.join(test_dir, 'admin_scripts', 'custom_templates', 'project_template.tgz')
+ args = ['startproject', '--template', template_path, 'tarballtestproject', 'altlocation']
+ testproject_dir = os.path.join(test_dir, 'altlocation')
+ os.mkdir(testproject_dir)
+
+ 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, 'run.py')))
+
def test_custom_project_template_from_tarball_by_url(self):
"Make sure the startproject management command is able to use a different project template from a tarball via a url"
template_url = '%s/admin_scripts/custom_templates/project_template.tgz' % self.live_server_url