Files
edx-platform/common/djangoapps/microsite_configuration/tests/test_microsites.py
Felipe Montoya f2a6a27ec9 Adding support for microsite template_paths on django templates
Stripping the leading / for the django_templates finder

Enabling the microsite configurations before running django.setup()

Adding only the templates directory before startup

Adding the missing overrides file at the django templates main

Using the comp_theming way of overriding css

Adding test for the microsite_template_path filter
2016-01-12 10:34:00 -05:00

42 lines
1.4 KiB
Python

# -*- coding: utf-8 -*-
"""
Tests microsite_configuration templatetags and helper functions.
"""
from django.test import TestCase
from django.conf import settings
from microsite_configuration.templatetags import microsite
class MicroSiteTests(TestCase):
"""
Make sure some of the helper functions work
"""
def test_breadcrumbs(self):
crumbs = ['my', 'less specific', 'Page']
expected = u'my | less specific | Page | edX'
title = microsite.page_title_breadcrumbs(*crumbs)
self.assertEqual(expected, title)
def test_unicode_title(self):
crumbs = [u'øo', u'π tastes gréât', u'']
expected = u'øo | π tastes gréât | 驴 | edX'
title = microsite.page_title_breadcrumbs(*crumbs)
self.assertEqual(expected, title)
def test_platform_name(self):
pname = microsite.platform_name()
self.assertEqual(pname, settings.PLATFORM_NAME)
def test_breadcrumb_tag(self):
crumbs = ['my', 'less specific', 'Page']
expected = u'my | less specific | Page | edX'
title = microsite.page_title_breadcrumbs_tag(None, *crumbs)
self.assertEqual(expected, title)
def test_microsite_template_path(self):
"""
When an unexistent path is passed to the filter, it should return the same path
"""
path = microsite.microsite_template_path('footer.html')
self.assertEqual("footer.html", path)