diff options
author | Rohith PR <praroh2@gmail.com> | 2021-05-11 16:09:28 +0530 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-05-14 12:45:00 +0200 |
commit | 530f58caaa5052e9e56bf8461caee4d821953bcb (patch) | |
tree | f4703d39d9e7f1ae11285d27f041e9177d43d253 /tests/admin_scripts | |
parent | 29345aecf6e8d53ccb3577a3762bb0c263f7558d (diff) | |
download | django-530f58caaa5052e9e56bf8461caee4d821953bcb.tar.gz |
Fixed #32734 -- Fixed validation of startapp's directory with trailing slash.
Regression in fc9566d42daf28cdaa25a5db1b5ade253ceb064f.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r-- | tests/admin_scripts/tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index fd94d4919f..8dd06f660b 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -2206,6 +2206,13 @@ class StartApp(AdminScriptTestCase): "another directory." ) + def test_trailing_slash_in_target_app_directory_name(self): + app_dir = os.path.join(self.test_dir, 'apps', 'app1') + os.makedirs(app_dir) + _, err = self.run_django_admin(['startapp', 'app', os.path.join('apps', 'app1', '')]) + self.assertNoOutput(err) + self.assertIs(os.path.exists(os.path.join(app_dir, 'apps.py')), True) + def test_overlaying_app(self): # Use a subdirectory so it is outside the PYTHONPATH. os.makedirs(os.path.join(self.test_dir, 'apps/app1')) |