A test for optional_include_mako

This commit is contained in:
Ned Batchelder
2015-09-09 07:01:31 -04:00
committed by David Baumgold
parent e1c898ff40
commit 200adfaa06
4 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
# Only for testing.
<p>This is test_exists.html</p>

View File

@@ -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" />

View 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)