Skip to content

Commit

Permalink
removed a web2py specific test (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdipierro committed Feb 18, 2019
1 parent 1e05333 commit 6584341
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import unittest
import sys

import template
from template import render
from yatl import render
from yatl.template import DummyResponse, RestrictedError, NOESCAPE


class TestTemplate(unittest.TestCase):
Expand Down Expand Up @@ -68,7 +68,6 @@ def testWithDummyFileSystem(self):
from cStringIO import StringIO
else:
from io import StringIO
from template import RestrictedError

@contextlib.contextmanager
def monkey_patch(module, fn_name, patch):
Expand Down Expand Up @@ -121,19 +120,19 @@ def dummy_open(path):
render(filename=pjoin('views', 'default', 'indexbrackets.html'),
path='views', delimiters='[[ ]]', reader=dummy_open),
'left to right')
self.assertRaises(
RestrictedError,
render,
filename=pjoin('views', 'default', 'missing.html'),
path='views',
reader=dummy_open)
response = template.DummyResponse()
#self.assertRaises(
# RestrictedError,
# render,
# filename=pjoin('views', 'default', 'missing.html'),
# path='views',
# reader=dummy_open)
response = DummyResponse()
response.delimiters = ('[[', ']]')
self.assertEqual(
render(filename=pjoin('views', 'default', 'indexbrackets.html'),
path='views', context={'response': response}, reader=dummy_open),
'left to right')
self.assertEqual(
render(filename=pjoin('views', 'default', 'noescape.html'),
context={'NOESCAPE': template.NOESCAPE}, reader=dummy_open),
context={'NOESCAPE': NOESCAPE}, reader=dummy_open),
'<script></script>')

0 comments on commit 6584341

Please sign in to comment.