diff --git a/t/db_dependent/Koha/Middleware/ContentSecurityPolicy.t b/t/db_dependent/Koha/Middleware/ContentSecurityPolicy.t
index 3e05e5c36f..5b3b7a40e9 100755
--- a/t/db_dependent/Koha/Middleware/ContentSecurityPolicy.t
+++ b/t/db_dependent/Koha/Middleware/ContentSecurityPolicy.t
@@ -83,7 +83,7 @@ subtest 'test Content-Security-Policy header in a minimal environment' => sub {
"Response contains Content-Security-Policy header with the expected value"
);
is(
- $res->content, '' . "\n",
+ $res->content, "\n" . ' ' . "\n",
"Response contains generated nonce in the body"
);
diff --git a/t/mock_templates/opac-tmpl/bootstrap/en/modules/opac-csp.tt b/t/mock_templates/opac-tmpl/bootstrap/en/modules/opac-csp.tt
index 80d65e6b71..2016d86fe4 100644
--- a/t/mock_templates/opac-tmpl/bootstrap/en/modules/opac-csp.tt
+++ b/t/mock_templates/opac-tmpl/bootstrap/en/modules/opac-csp.tt
@@ -1,2 +1,3 @@
-[% USE raw %][% USE Koha %]