diff --git a/csp/tests/test_jinja_extension.py b/csp/tests/test_jinja_extension.py index f6e573f..227feb3 100644 --- a/csp/tests/test_jinja_extension.py +++ b/csp/tests/test_jinja_extension.py @@ -42,7 +42,7 @@ def test_async_attribute_with_falsey(self): var hello='world'; {% endscript %}""" - expected = '" + expected = '' self.assert_template_eq(*self.process_templates(tpl, expected)) @@ -52,7 +52,7 @@ def test_async_attribute_with_truthy(self): var hello='world'; {% endscript %}""" - expected = '" + expected = '' self.assert_template_eq(*self.process_templates(tpl, expected)) @@ -66,7 +66,7 @@ def test_nested_script_tags_are_removed(self): {% endscript %}""" - expected = "' "var hello='world';" + expected = '' self.assert_template_eq(*self.process_templates(tpl, expected)) @@ -82,6 +82,6 @@ def test_regex_captures_script_content_including_brackets(self): {% endscript %} """ - expected = '"' "" + expected = '"' self.assert_template_eq(*self.process_templates(tpl, expected)) diff --git a/csp/tests/test_templatetags.py b/csp/tests/test_templatetags.py index 03e5953..45e96d5 100644 --- a/csp/tests/test_templatetags.py +++ b/csp/tests/test_templatetags.py @@ -29,7 +29,7 @@ def test_script_tag_sets_attrs_correctly(self): var hello='world'; {% endscript %}""" - expected = "' "var hello='world';" + expected = '' self.assert_template_eq(*self.process_templates(tpl, expected)) @@ -65,7 +65,7 @@ def test_nested_script_tags_are_removed(self): {% endscript %}""" - expected = "' "var hello='world';" + expected = '' self.assert_template_eq(*self.process_templates(tpl, expected)) @@ -82,6 +82,6 @@ def test_regex_captures_script_content_including_brackets(self): {% endscript %} """ - expected = '"' "" + expected = '"' self.assert_template_eq(*self.process_templates(tpl, expected)) diff --git a/csp/tests/test_utils.py b/csp/tests/test_utils.py index 39c687d..b5f6a60 100644 --- a/csp/tests/test_utils.py +++ b/csp/tests/test_utils.py @@ -251,7 +251,7 @@ def test_require_trusted_types_for(): def test_trusted_types(): policy = build_policy() policy_eq( - "default-src 'self'; trusted-types strictPolicy laxPolicy " + "default 'allow-duplicates'", + "default-src 'self'; trusted-types strictPolicy laxPolicy default 'allow-duplicates'", policy, ) @@ -277,7 +277,7 @@ def test_nonce(): def test_nonce_include_in(): policy = build_policy(nonce="abc123") policy_eq( - ("default-src 'self'; " "script-src 'nonce-abc123'; " "style-src 'nonce-abc123'"), + "default-src 'self'; script-src 'nonce-abc123'; style-src 'nonce-abc123'", policy, )