diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-04-26 05:33:35 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-04-26 05:33:35 +0000 |
| commit | 8888a57341531bd1e50bd306bdff7a35c25c46da (patch) | |
| tree | d1e3494ab55077144fe7a7d69eca56f2c6573517 /repoze/bfg/tests | |
| parent | 05d03298c2e6faedb28786872ea47d5a04ae525f (diff) | |
| download | pyramid-8888a57341531bd1e50bd306bdff7a35c25c46da.tar.gz pyramid-8888a57341531bd1e50bd306bdff7a35c25c46da.tar.bz2 pyramid-8888a57341531bd1e50bd306bdff7a35c25c46da.zip | |
Be kind to KARL: don't assume "debug_templates" will be in the settings dict.
Diffstat (limited to 'repoze/bfg/tests')
| -rw-r--r-- | repoze/bfg/tests/test_chameleon_text.py | 10 | ||||
| -rw-r--r-- | repoze/bfg/tests/test_chameleon_zpt.py | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_chameleon_text.py b/repoze/bfg/tests/test_chameleon_text.py index 38bbc060c..cb30f489a 100644 --- a/repoze/bfg/tests/test_chameleon_text.py +++ b/repoze/bfg/tests/test_chameleon_text.py @@ -90,6 +90,16 @@ class TextTemplateRendererTests(Base, unittest.TestCase): template = instance.template self.assertEqual(template.auto_reload, True) + def test_template_with_emptydict(self): + from repoze.bfg.interfaces import ISettings + self.config.registry.registerUtility({}, ISettings) + minimal = self._getTemplatePath('minimal.txt') + instance = self._makeOne(minimal) + self.failIf('template' in instance.__dict__) + template = instance.template + self.assertEqual(template.auto_reload, False) + self.assertEqual(template.debug, False) + 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 b24a0430c..4ea5fc281 100644 --- a/repoze/bfg/tests/test_chameleon_zpt.py +++ b/repoze/bfg/tests/test_chameleon_zpt.py @@ -91,6 +91,16 @@ class ZPTTemplateRendererTests(Base, unittest.TestCase): template = instance.template self.assertEqual(template.auto_reload, True) + def test_template_with_emptydict(self): + from repoze.bfg.interfaces import ISettings + self.config.registry.registerUtility({}, ISettings) + minimal = self._getTemplatePath('minimal.pt') + instance = self._makeOne(minimal) + self.failIf('template' in instance.__dict__) + template = instance.template + self.assertEqual(template.auto_reload, False) + self.assertEqual(template.debug, False) + def test_call_with_nondict_value(self): minimal = self._getTemplatePath('minimal.pt') instance = self._makeOne(minimal) |
