update warning message, fix tests

This commit is contained in:
Kenneth Kehl
2023-11-28 07:42:33 -08:00
6 changed files with 19 additions and 16 deletions

View File

@@ -17,7 +17,8 @@ def test_owasp_useful_headers_set(
assert search(r"form-action 'self';", csp)
assert search(
r"script-src 'self' static\.example\.com 'unsafe-eval' https:\/\/js-agent\.new"
r"relic\.com https:\/\/gov-bam\.nr-data\.net 'nonce-.*';",
r"relic\.com https:\/\/gov-bam\.nr-data\.net https:\/\/www\.googletagmanager\."
r"com 'nonce-.*';",
csp,
)
assert search(r"connect-src 'self' https:\/\/gov-bam.nr-data\.net;", csp)

View File

@@ -2113,7 +2113,7 @@ def test_content_count_json_endpoint(
html = json.loads(response.get_data(as_text=True))["html"]
snippet = BeautifulSoup(html, "html.parser").select_one("span")
assert normalize_spaces(snippet.text) == expected_message
assert expected_message in normalize_spaces(snippet.text)
if snippet.has_attr("class"):
assert snippet["class"] == [expected_class]