Corrected usage of the title block for the main_django template

ECOM-4610
This commit is contained in:
Clinton Blackburn
2016-06-06 13:54:45 -04:00
parent 6bc0fa2bd3
commit 77f605b30a
5 changed files with 37 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
""" Django template ontext processors. """
from django.conf import settings
from microsite_configuration import microsite
def microsite_context(request): # pylint: disable=unused-argument
return {
'platform_name': microsite.get_value('platform_name', settings.PLATFORM_NAME)
}

View File

@@ -0,0 +1,21 @@
""" Tests for Django template context processors. """
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from microsite_configuration.context_processors import microsite_context
PLATFORM_NAME = 'Test Platform'
@override_settings(PLATFORM_NAME=PLATFORM_NAME)
class MicrositeContextProcessorTests(TestCase):
""" Tests for the microsite context processor. """
def setUp(self):
request = RequestFactory().get('/')
self.context = microsite_context(request)
def test_platform_name(self):
""" Verify the context includes the platform name. """
self.assertEqual(self.context['platform_name'], PLATFORM_NAME)