1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #33476 -- Reformatted code with Black.

This commit is contained in:
django-bot
2022-02-03 20:24:19 +01:00
committed by Mariusz Felisiak
parent f68fa8b45d
commit 9c19aff7c7
1992 changed files with 139577 additions and 96284 deletions

View File

@@ -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",
],
)