Commit 77f605b3 by Clinton Blackburn

Corrected usage of the title block for the main_django template

ECOM-4610
parent 6bc0fa2b
""" 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)
}
""" 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)
......@@ -499,6 +499,7 @@ TEMPLATES = [
'django.template.context_processors.i18n',
'django.contrib.auth.context_processors.auth', # this is required for admin
'django.template.context_processors.csrf',
'microsite_configuration.context_processors.microsite_context',
# Added for django-wiki
'django.template.context_processors.media',
......
......@@ -4,7 +4,7 @@
<html lang="{{LANGUAGE_CODE}}">
<head>
<meta charset="UTF-8">
{% block title %}<title>{% platform_name %}</title>{% endblock %}
<title>{% block title %}{{ platform_name }}{% endblock %}</title>
<link rel="icon" type="image/x-icon" href="{% favicon_path %}" />
......
......@@ -2,7 +2,9 @@
{% with online_help_token="wiki" %}
{% load pipeline %}{% load sekizai_tags i18n microsite %}{% load url from future %}{% load staticfiles %}
{% block title %}<title>{% block pagetitle %}{% endblock %} | {% trans "Wiki" %} | {% platform_name %}</title>{% endblock %}
{% block title %}
{% block pagetitle %}{% endblock %} | {% trans "Wiki" %} | {% platform_name %}
{% endblock %}
{% block bodyclass %}view-in-course view-wiki{% endblock %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment