A test for optional_include_mako
This commit is contained in:
committed by
David Baumgold
parent
e1c898ff40
commit
200adfaa06
@@ -0,0 +1,2 @@
|
||||
# Only for testing.
|
||||
<p>This is test_exists.html</p>
|
||||
@@ -0,0 +1,8 @@
|
||||
# A test template for optional_include_mako
|
||||
|
||||
<%namespace name='static' file='static_content.html'/>
|
||||
|
||||
<p>Welcome to test_optional_include_mako.html</p>
|
||||
|
||||
<%static:optional_include_mako file="test_exists.html" />
|
||||
<%static:optional_include_mako file="definitely_doesnt_exist.html" />
|
||||
0
common/djangoapps/pipeline_mako/tests/__init__.py
Normal file
0
common/djangoapps/pipeline_mako/tests/__init__.py
Normal file
16
common/djangoapps/pipeline_mako/tests/test_static_content.py
Normal file
16
common/djangoapps/pipeline_mako/tests/test_static_content.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
Tests of pipeline_mako/templates/static_content.html
|
||||
"""
|
||||
|
||||
import unittest
|
||||
|
||||
from edxmako.shortcuts import render_to_string
|
||||
|
||||
|
||||
class TestStaticContent(unittest.TestCase):
|
||||
"""Tests for static_content.html"""
|
||||
|
||||
def test_optional_include_mako(self):
|
||||
out = render_to_string("test_optional_include_mako.html", {})
|
||||
self.assertIn("Welcome to test_optional_include_mako.html", out)
|
||||
self.assertIn("This is test_exists.html", out)
|
||||
Reference in New Issue
Block a user