diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-12-17 01:17:48 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-12-17 01:17:48 +0000 |
| commit | 5babbaf48a71af786d41f59a1f1f7d5272a60a4d (patch) | |
| tree | 4c3c4264e73410db07baffaebd879b36c4ae5aed /repoze/bfg/tests/test_chameleon_zpt.py | |
| parent | 0bf2866211d095a18a5c61d7af644c8e17486e6e (diff) | |
| download | pyramid-5babbaf48a71af786d41f59a1f1f7d5272a60a4d.tar.gz pyramid-5babbaf48a71af786d41f59a1f1f7d5272a60a4d.tar.bz2 pyramid-5babbaf48a71af786d41f59a1f1f7d5272a60a4d.zip | |
- When Chameleon page or text templates were added imperatively (via
``Configurator.add_view`` or some derivative), they too-eagerly
attempted to look up the ``reload_templates`` setting via
``get_settings``, meaning they were always registered in
non-auto-reload-mode (the default). Each now waits until its
respective ``template`` attribute is accessed to look up the value.
Diffstat (limited to 'repoze/bfg/tests/test_chameleon_zpt.py')
| -rw-r--r-- | repoze/bfg/tests/test_chameleon_zpt.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_chameleon_zpt.py b/repoze/bfg/tests/test_chameleon_zpt.py index 38ef543cf..e4bf8f766 100644 --- a/repoze/bfg/tests/test_chameleon_zpt.py +++ b/repoze/bfg/tests/test_chameleon_zpt.py @@ -48,6 +48,13 @@ class ZPTTemplateRendererTests(Base, unittest.TestCase): self.assertEqual(result, '<div xmlns="http://www.w3.org/1999/xhtml">\n</div>') + def test_template_reified(self): + minimal = self._getTemplatePath('minimal.pt') + instance = self._makeOne(minimal) + self.failIf('template' in instance.__dict__) + template = instance.template + self.assertEqual(template, instance.__dict__['template']) + def test_call_with_nondict_value(self): minimal = self._getTemplatePath('minimal.pt') instance = self._makeOne(minimal) |
