Skip to content

Commit f275611

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent abe5c9d commit f275611

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/test_csp_rendering.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_exists(self):
6868
"""A `nonce` should exist when using the `CSPMiddleware`."""
6969
response = self.client.get(path="/regular/basic/")
7070
if not isinstance(response, HttpResponse):
71-
raise self.failureException(f'{response!r} is not a HttpResponse')
71+
raise self.failureException(f"{response!r} is not a HttpResponse")
7272
self.assertEqual(response.status_code, 200)
7373

7474
html_root: Element = self.parser.parse(stream=response.content)
@@ -92,16 +92,15 @@ def test_exists(self):
9292
def test_redirects_exists(self):
9393
response = self.client.get("/redirect/")
9494
if not isinstance(response, HttpResponse):
95-
raise self.failureException(f'{response!r} is not a HttpResponse')
95+
raise self.failureException(f"{response!r} is not a HttpResponse")
9696
self.assertEqual(response.status_code, 200)
9797

9898
html_root: Element = self.parser.parse(stream=response.content)
9999
self._fail_on_invalid_html(content=response.content, parser=self.parser)
100100
self.assertContains(response, "djDebug")
101101

102102
namespaces = get_namespaces(element=html_root)
103-
context: ContextList = \
104-
response.context # pyright: ignore[reportAttributeAccessIssue]
103+
context: ContextList = response.context # pyright: ignore[reportAttributeAccessIssue]
105104
nonce = str(context["toolbar"].request.csp_nonce)
106105
self._fail_if_missing(
107106
root=html_root, path=".//link", namespaces=namespaces, nonce=nonce
@@ -116,7 +115,7 @@ def test_redirects_exists(self):
116115
def test_panel_content_nonce_exists(self):
117116
response = self.client.get("/regular/basic/")
118117
if not isinstance(response, HttpResponse):
119-
raise self.failureException(f'{response!r} is not a HttpResponse')
118+
raise self.failureException(f"{response!r} is not a HttpResponse")
120119
self.assertEqual(response.status_code, 200)
121120

122121
toolbar = list(DebugToolbar._store.values())[0]
@@ -137,7 +136,7 @@ def test_missing(self):
137136
"""A `nonce` should not exist when not using the `CSPMiddleware`."""
138137
response = self.client.get(path="/regular/basic/")
139138
if not isinstance(response, HttpResponse):
140-
raise self.failureException(f'{response!r} is not a HttpResponse')
139+
raise self.failureException(f"{response!r} is not a HttpResponse")
141140
self.assertEqual(response.status_code, 200)
142141

143142
html_root: Element = self.parser.parse(stream=response.content)

0 commit comments

Comments
 (0)