Fixed #24252 -- Forced lazy __str__ to utf-8 on Python 2

Thanks Stanislas Guerra for the report and Tomas Ehrlich for
the review.
This commit is contained in:
Claude Paroz 2015-01-31 16:05:16 +01:00
parent 250aa7c39b
commit cd0ceaa102
2 changed files with 15 additions and 0 deletions

View file

@ -318,6 +318,17 @@ class ReverseLazyTest(TestCase):
response = self.client.get('/login_required_view/')
self.assertEqual(response.status_code, 200)
def test_inserting_reverse_lazy_into_string(self):
self.assertEqual(
'Some URL: %s' % reverse_lazy('some-login-page'),
'Some URL: /login/'
)
if six.PY2:
self.assertEqual(
b'Some URL: %s' % reverse_lazy('some-login-page'),
'Some URL: /login/'
)
class ReverseLazySettingsTest(AdminScriptTestCase):
"""