summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorsage <laymonage@gmail.com>2021-09-01 11:03:03 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-09-01 11:05:10 +0200
commit3686077d463685d383e14b4695eaaa2658919a42 (patch)
tree0d6237f9c4dcb555a5d2530cfa789f15870e6b3d /tests/admin_scripts
parentaf10e97531a59e4af09b5ec0c1a3ea476f2b6015 (diff)
downloaddjango-3686077d463685d383e14b4695eaaa2658919a42.tar.gz
Refs #32309 -- Added test for excluding hidden directories in startproject command.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/custom_templates/project_template/.hidden/render.py1
-rw-r--r--tests/admin_scripts/tests.py18
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/admin_scripts/custom_templates/project_template/.hidden/render.py b/tests/admin_scripts/custom_templates/project_template/.hidden/render.py
new file mode 100644
index 0000000000..e076853b25
--- /dev/null
+++ b/tests/admin_scripts/custom_templates/project_template/.hidden/render.py
@@ -0,0 +1 @@
+# The {{ project_name }} should be rendered.
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index a3ceb8ad75..bed9c61b31 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -2214,6 +2214,24 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
'Some non-ASCII text for testing ticket #18091:',
'üäö €'])
+ def test_custom_project_template_hidden_directory_default_excluded(self):
+ """Hidden directories are excluded by default."""
+ template_path = os.path.join(custom_templates_dir, 'project_template')
+ args = [
+ 'startproject',
+ '--template',
+ template_path,
+ 'custom_project_template_hidden_directories',
+ 'project_dir',
+ ]
+ testproject_dir = os.path.join(self.test_dir, 'project_dir')
+ os.mkdir(testproject_dir)
+
+ _, err = self.run_django_admin(args)
+ self.assertNoOutput(err)
+ hidden_dir = os.path.join(testproject_dir, '.hidden')
+ self.assertIs(os.path.exists(hidden_dir), False)
+
class StartApp(AdminScriptTestCase):