summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-02-19 13:26:36 (GMT)
committerGeorg Brandl <georg@python.org>2006-02-19 13:26:36 (GMT)
commit602b9ba6b37c4ac4ed445f8c9e9dccd68d631899 (patch)
tree576f560d4ba24b2c975d35a7718ca1c5a2cfbf57 /Lib/test
parente466217ab954c5a53fc2e0b78876385362120900 (diff)
downloadcpython-602b9ba6b37c4ac4ed445f8c9e9dccd68d631899.zip
cpython-602b9ba6b37c4ac4ed445f8c9e9dccd68d631899.tar.gz
cpython-602b9ba6b37c4ac4ed445f8c9e9dccd68d631899.tar.bz2
Patch #1349274: gettext.install() now optionally installs additional
translation functions other than _() in the builtin namespace.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_gettext.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py
index 517dfc0..76253de 100644
--- a/Lib/test/test_gettext.py
+++ b/Lib/test/test_gettext.py
@@ -145,6 +145,14 @@ trggrkg zrffntr pngnybt yvoenel.''')
# Try unicode return type
t.install(unicode=True)
eq(_('mullusk'), 'bacon')
+ # Test installation of other methods
+ import __builtin__
+ t.install(unicode=True, names=["gettext", "lgettext"])
+ eq(_, t.ugettext)
+ eq(__builtin__.gettext, t.ugettext)
+ eq(lgettext, t.lgettext)
+ del __builtin__.gettext
+ del __builtin__.lgettext
class GettextTestCase2(GettextBaseTest):