summaryrefslogtreecommitdiff
path: root/src/zope/i18n/tests/test_formats.py
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2017-12-17 09:57:13 -0600
committerJason Madden <jamadden@gmail.com>2017-12-17 09:57:13 -0600
commit47ee44a0c1368f2f3c09b1055eef934449f3c584 (patch)
tree3a316555acc574ca93209afada4d11e3e53417d0 /src/zope/i18n/tests/test_formats.py
parenta4cf800dc23b5fc3072e26db539edc3c92891113 (diff)
downloadzope-i18n-47ee44a0c1368f2f3c09b1055eef934449f3c584.tar.gz
Make [Simple]TranslationDomain and GettextMessageCatalog properly implement their interfaces on Python 2 when given native strings for 'domain' and 'language'---these are supposed to be text. Test this.
Diffstat (limited to 'src/zope/i18n/tests/test_formats.py')
-rw-r--r--src/zope/i18n/tests/test_formats.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/zope/i18n/tests/test_formats.py b/src/zope/i18n/tests/test_formats.py
index a77fc8e..6d1380d 100644
--- a/src/zope/i18n/tests/test_formats.py
+++ b/src/zope/i18n/tests/test_formats.py
@@ -99,9 +99,9 @@ class LocaleCalendarStub(object):
class _TestCase(TestCase):
- if not hasattr(TestCase, 'assertRaisesRegex'):
- # Avoid deprecation warnings in Python 3
- assertRaisesRegex = TestCase.assertRaisesRegexp
+ # Avoid deprecation warnings in Python 3 by making the preferred
+ # method name available for Python 2.
+ assertRaisesRegex = getattr(TestCase, 'assertRaisesRegex', TestCase.assertRaisesRegexp)
class TestDateTimePatternParser(_TestCase):