diff options
Diffstat (limited to 'tests/project_template')
| -rw-r--r-- | tests/project_template/test_settings.py | 33 | ||||
| -rw-r--r-- | tests/project_template/urls.py | 2 |
2 files changed, 19 insertions, 16 deletions
diff --git a/tests/project_template/test_settings.py b/tests/project_template/test_settings.py index e526e10331..ba3dee7405 100644 --- a/tests/project_template/test_settings.py +++ b/tests/project_template/test_settings.py @@ -13,11 +13,11 @@ class TestStartProjectSettings(SimpleTestCase): self.addCleanup(self.temp_dir.cleanup) template_settings_py = os.path.join( os.path.dirname(conf.__file__), - 'project_template', - 'project_name', - 'settings.py-tpl', + "project_template", + "project_name", + "settings.py-tpl", ) - test_settings_py = os.path.join(self.temp_dir.name, 'test_settings.py') + test_settings_py = os.path.join(self.temp_dir.name, "test_settings.py") shutil.copyfile(template_settings_py, test_settings_py) def test_middleware_headers(self): @@ -31,15 +31,18 @@ class TestStartProjectSettings(SimpleTestCase): with self.settings( MIDDLEWARE=MIDDLEWARE, - ROOT_URLCONF='project_template.urls', + ROOT_URLCONF="project_template.urls", ): - response = self.client.get('/empty/') - headers = sorted(response.serialize_headers().split(b'\r\n')) - self.assertEqual(headers, [ - b'Content-Length: 0', - b'Content-Type: text/html; charset=utf-8', - b'Cross-Origin-Opener-Policy: same-origin', - b'Referrer-Policy: same-origin', - b'X-Content-Type-Options: nosniff', - b'X-Frame-Options: DENY', - ]) + response = self.client.get("/empty/") + headers = sorted(response.serialize_headers().split(b"\r\n")) + self.assertEqual( + headers, + [ + b"Content-Length: 0", + b"Content-Type: text/html; charset=utf-8", + b"Cross-Origin-Opener-Policy: same-origin", + b"Referrer-Policy: same-origin", + b"X-Content-Type-Options: nosniff", + b"X-Frame-Options: DENY", + ], + ) diff --git a/tests/project_template/urls.py b/tests/project_template/urls.py index 5a368ecef7..ae864b8e2d 100644 --- a/tests/project_template/urls.py +++ b/tests/project_template/urls.py @@ -3,5 +3,5 @@ from django.urls import path from . import views urlpatterns = [ - path('empty/', views.empty_view), + path("empty/", views.empty_view), ] |
