diff options
author | Marius Gedminas <marius@gedmin.as> | 2013-02-18 08:32:44 +0000 |
---|---|---|
committer | Marius Gedminas <marius@gedmin.as> | 2013-02-18 08:32:44 +0000 |
commit | 4abb07072601a7a31bd12af2afe8cf5f69cd61e4 (patch) | |
tree | 2b2d5cf24ad7327b72de76ff5a4ee53776eb7e0f /src | |
parent | 3804a10ed051d40e3f2139a7488c568fa11f7493 (diff) | |
download | zope-i18n-4abb07072601a7a31bd12af2afe8cf5f69cd61e4.tar.gz |
Restore zope.i18n.testing.{setUp,PlacelessSetup}.
These are required by zope.app.testing, and not having them breaks a bunch of
packages on winbot.
On the other hand, the setup requires zope.publisher, which isn't ported to
Python 3 yet.
I've decided on a (bad?) compromise: move the zope.publisher imports inside
zope.i18n.testing.setUp.
Diffstat (limited to 'src')
-rw-r--r-- | src/zope/i18n/testing.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/zope/i18n/testing.py b/src/zope/i18n/testing.py index 293928b..2a63da6 100644 --- a/src/zope/i18n/testing.py +++ b/src/zope/i18n/testing.py @@ -16,6 +16,7 @@ import sys import re + if sys.version_info[0] == 2: import doctest unicode_checker = doctest.OutputChecker() @@ -25,3 +26,18 @@ else: (re.compile('u(".*?")'), r"\1"), ] unicode_checker = renormalizing.RENormalizing(rules) + + +def setUp(test=None): + import zope.component + from zope.publisher.browser import BrowserLanguages + from zope.publisher.http import HTTPCharsets + zope.component.provideAdapter(HTTPCharsets) + zope.component.provideAdapter(BrowserLanguages) + + +class PlacelessSetup(object): + + def setUp(self): + setUp() + |