Code

Ticket #4796: 4796-fix.diff

File 4796-fix.diff, 1.1 KB (added by durdinator, 7 years ago)

Patch, with regression test (fix typo)

Line 
1Index: django/utils/translation/__init__.py
2===================================================================
3--- django/utils/translation/__init__.py        (revision 6411)
4+++ django/utils/translation/__init__.py        (working copy)
5@@ -39,7 +39,7 @@
6             g['real_%s' % name] = getattr(trans, name)
7 
8     # Make the originally requested function call on the way out the door.
9-    return g[caller](*args, **kwargs)
10+    return g['real_%s' % caller](*args, **kwargs)
11 
12 g = globals()
13 for name in __all__:
14Index: tests/regressiontests/i18n/tests.py
15===================================================================
16--- tests/regressiontests/i18n/tests.py (revision 6411)
17+++ tests/regressiontests/i18n/tests.py (working copy)
18@@ -30,4 +30,12 @@
19 >>> s4 = ugettext_lazy('Some other string')
20 >>> s == s4
21 False
22+
23+unicode(string_concat(...)) should not raise a TypeError - #4796
24+
25+>>> import django.utils.translation
26+>>> reload(django.utils.translation)
27+<module 'django.utils.translation' from ...>
28+>>> unicode(django.utils.translation.string_concat("dja", "ngo"))
29+u'django'
30 """