diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-04-25 00:02:12 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-04-25 00:02:12 +0000 |
| commit | 7534bae0c5eeb34a0146e76a81a9312797f6ba5c (patch) | |
| tree | 15d3fd388eb3c5538c50da20c3691a9f39ca6de3 /repoze/bfg/tests/test_chameleon_text.py | |
| parent | 51981a128c7ed05e51938a3f358c0970dcc33a6f (diff) | |
| download | pyramid-7534bae0c5eeb34a0146e76a81a9312797f6ba5c.tar.gz pyramid-7534bae0c5eeb34a0146e76a81a9312797f6ba5c.tar.bz2 pyramid-7534bae0c5eeb34a0146e76a81a9312797f6ba5c.zip | |
Merge i18n branch via svn merge --ignore-ancestry -r9030:9150 $REPOZE_SVN/repoze.bfg/branches/i18n
No foreigners were harmed in the coding of this feature.
Diffstat (limited to 'repoze/bfg/tests/test_chameleon_text.py')
| -rw-r--r-- | repoze/bfg/tests/test_chameleon_text.py | 20 |
1 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 007c102e3..204805adb 100644 --- a/repoze/bfg/tests/test_chameleon_text.py +++ b/repoze/bfg/tests/test_chameleon_text.py @@ -28,6 +28,16 @@ class Base: class TextTemplateRendererTests(Base, unittest.TestCase): + def setUp(self): + from repoze.bfg.configuration import Configurator + from repoze.bfg.registry import Registry + registry = Registry() + self.config = Configurator(registry=registry) + self.config.begin() + + def tearDown(self): + self.config.end() + def _getTargetClass(self): from repoze.bfg.chameleon_text import TextTemplateRenderer return TextTemplateRenderer @@ -54,6 +64,16 @@ class TextTemplateRendererTests(Base, unittest.TestCase): template = instance.template self.assertEqual(template, instance.__dict__['template']) + def test_template_with_ichameleon_translate(self): + from repoze.bfg.interfaces import IChameleonTranslate + def ct(): pass + self.config.registry.registerUtility(ct, IChameleonTranslate) + minimal = self._getTemplatePath('minimal.txt') + instance = self._makeOne(minimal) + self.failIf('template' in instance.__dict__) + template = instance.template + self.assertEqual(template.translate, ct) + def test_call(self): minimal = self._getTemplatePath('minimal.txt') instance = self._makeOne(minimal) |
