summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-04-25 17:23:45 +0000
committerChris McDonough <chrism@agendaless.com>2010-04-25 17:23:45 +0000
commit36ca7c9f7f1b177d69be792f98fda054d7c36c45 (patch)
tree3941378adbfdac9e60d660151eb99352e04646e4
parent36173864894f31ffd35d904bb16e700d60e7f531 (diff)
downloadpyramid-36ca7c9f7f1b177d69be792f98fda054d7c36c45.tar.gz
pyramid-36ca7c9f7f1b177d69be792f98fda054d7c36c45.tar.bz2
pyramid-36ca7c9f7f1b177d69be792f98fda054d7c36c45.zip
Add tests for debug_templates (backfill for reload_templates).
-rw-r--r--repoze/bfg/tests/test_chameleon_text.py16
-rw-r--r--repoze/bfg/tests/test_chameleon_zpt.py16
2 files changed, 32 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_chameleon_text.py b/repoze/bfg/tests/test_chameleon_text.py
index 204805adb..38bbc060c 100644
--- a/repoze/bfg/tests/test_chameleon_text.py
+++ b/repoze/bfg/tests/test_chameleon_text.py
@@ -74,6 +74,22 @@ class TextTemplateRendererTests(Base, unittest.TestCase):
template = instance.template
self.assertEqual(template.translate, ct)
+ def test_template_with_debug_templates(self):
+ self.config.add_settings({'debug_templates':True})
+ minimal = self._getTemplatePath('minimal.txt')
+ instance = self._makeOne(minimal)
+ self.failIf('template' in instance.__dict__)
+ template = instance.template
+ self.assertEqual(template.debug, True)
+
+ def test_template_with_reload_templates(self):
+ self.config.add_settings({'reload_templates':True})
+ minimal = self._getTemplatePath('minimal.txt')
+ instance = self._makeOne(minimal)
+ self.failIf('template' in instance.__dict__)
+ template = instance.template
+ self.assertEqual(template.auto_reload, True)
+
def test_call(self):
minimal = self._getTemplatePath('minimal.txt')
instance = self._makeOne(minimal)
diff --git a/repoze/bfg/tests/test_chameleon_zpt.py b/repoze/bfg/tests/test_chameleon_zpt.py
index cbf9dd10b..b24a0430c 100644
--- a/repoze/bfg/tests/test_chameleon_zpt.py
+++ b/repoze/bfg/tests/test_chameleon_zpt.py
@@ -75,6 +75,22 @@ class ZPTTemplateRendererTests(Base, unittest.TestCase):
template = instance.template
self.assertEqual(template.translate, ct)
+ def test_template_with_debug_templates(self):
+ self.config.add_settings({'debug_templates':True})
+ minimal = self._getTemplatePath('minimal.pt')
+ instance = self._makeOne(minimal)
+ self.failIf('template' in instance.__dict__)
+ template = instance.template
+ self.assertEqual(template.debug, True)
+
+ def test_template_with_reload_templates(self):
+ self.config.add_settings({'reload_templates':True})
+ minimal = self._getTemplatePath('minimal.pt')
+ instance = self._makeOne(minimal)
+ self.failIf('template' in instance.__dict__)
+ template = instance.template
+ self.assertEqual(template.auto_reload, True)
+
def test_call_with_nondict_value(self):
minimal = self._getTemplatePath('minimal.pt')
instance = self._makeOne(minimal)