diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index 9e94840..1bcef2d 100644
a
|
b
|
def do_translate(message, translation_function):
|
246 | 246 | """ |
247 | 247 | global _default |
248 | 248 | |
249 | | eol_message = message.replace('\r\n', '\n').replace('\r', '\n') |
| 249 | # str() is allowing a bytestring message to remain bytestring on Python 2 |
| 250 | eol_message = message.replace(str('\r\n'), str('\n')).replace(str('\r'), str('\n')) |
250 | 251 | t = getattr(_active, "value", None) |
251 | 252 | if t is not None: |
252 | 253 | result = getattr(t, translation_function)(eol_message) |
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py
index 4054f85..2e0c097 100644
a
|
b
|
class TranslationTests(TestCase):
|
83 | 83 | s4 = ugettext_lazy('Some other string') |
84 | 84 | self.assertEqual(False, s == s4) |
85 | 85 | |
| 86 | if not six.PY3: |
| 87 | # On Python 2, gettext_lazy should not transform a bytestring to unicode |
| 88 | self.assertEqual(gettext_lazy(b"test").upper(), b"TEST") |
| 89 | |
86 | 90 | def test_lazy_pickle(self): |
87 | 91 | s1 = ugettext_lazy("test") |
88 | 92 | self.assertEqual(six.text_type(s1), "test") |