Skip to content

Commit

Permalink
Fixed the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kacperpONS committed Nov 6, 2024
1 parent ddcbee8 commit d5c7d9f
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions cms/core/tests/test_context_processors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

from django.test import RequestFactory, TestCase

from cms.core.context_processors import global_vars
Expand All @@ -19,21 +17,9 @@ def test_defaults_when_no_environment_settings_defined(self):
self.assertEqual(
global_vars(self.request),
{
"GOOGLE_TAG_MANAGER_ID": "",
"SEO_NOINDEX": False,
"LANGUAGE_CODE": "en-gb",
"IS_EXTERNAL_ENV": False,
},
)

def test_custom_values_when_environment_settings_defined(self):
"""Confirm the global vars include environment settings when defined."""
os.environ["GOOGLE_TAG_MANAGER_ID"] = "GTM-123456"

self.assertEqual(
global_vars(self.request),
{
"GOOGLE_TAG_MANAGER_ID": "GTM-123456",
"GOOGLE_TAG_MANAGER_CONTAINER_ID": "",
"ONS_COOKIE_BANNER_SERVICE_NAME": "www.ons.gov.uk",
"MANAGE_COOKIE_SETTINGS_URL": "https://www.ons.gov.uk/cookies",
"SEO_NOINDEX": False,
"LANGUAGE_CODE": "en-gb",
"IS_EXTERNAL_ENV": False,
Expand Down

0 comments on commit d5c7d9f

Please sign in to comment.