summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/custom_templates/project_template/additional_dir/requirements.in5
-rw-r--r--tests/admin_scripts/tests.py17
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/admin_scripts/custom_templates/project_template/additional_dir/requirements.in b/tests/admin_scripts/custom_templates/project_template/additional_dir/requirements.in
new file mode 100644
index 0000000000..77e66e2c93
--- /dev/null
+++ b/tests/admin_scripts/custom_templates/project_template/additional_dir/requirements.in
@@ -0,0 +1,5 @@
+# Should not be processed by `black`.
+Django<4.2
+environs[django]
+psycopg2-binary
+django-extensions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 9d2ca839d5..005ccb3312 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -2468,6 +2468,23 @@ 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_custom_project_template_non_python_files_not_formatted(self):
+ template_path = os.path.join(custom_templates_dir, "project_template")
+ args = ["startproject", "--template", template_path, "customtestproject"]
+ testproject_dir = os.path.join(self.test_dir, "customtestproject")
+
+ _, err = self.run_django_admin(args)
+ self.assertNoOutput(err)
+ with open(
+ os.path.join(template_path, "additional_dir", "requirements.in")
+ ) as f:
+ expected = f.read()
+ with open(
+ os.path.join(testproject_dir, "additional_dir", "requirements.in")
+ ) as f:
+ result = f.read()
+ self.assertEqual(expected, result)
+
def test_template_dir_with_trailing_slash(self):
"Ticket 17475: Template dir passed has a trailing path separator"
template_path = os.path.join(custom_templates_dir, "project_template" + os.sep)