mirror of
https://github.com/django/django.git
synced 2025-09-04 17:50:44 +00:00
Converted usage of ugettext* functions to their gettext* aliases
Thanks Tim Graham for the review.
This commit is contained in:
parent
4353640ea9
commit
c651331b34
129 changed files with 362 additions and 355 deletions
|
@ -9,7 +9,7 @@ from django.core.serializers.json import DjangoJSONEncoder
|
|||
from django.db import models
|
||||
from django.test import SimpleTestCase, TestCase, TransactionTestCase
|
||||
from django.test.utils import isolate_apps
|
||||
from django.utils.translation import override, ugettext_lazy
|
||||
from django.utils.translation import gettext_lazy, override
|
||||
|
||||
from .models import Score
|
||||
from .tests import SerializersTestBase, SerializersTransactionTestBase
|
||||
|
@ -292,12 +292,12 @@ class JsonSerializerTransactionTestCase(SerializersTransactionTestBase, Transact
|
|||
class DjangoJSONEncoderTests(SimpleTestCase):
|
||||
def test_lazy_string_encoding(self):
|
||||
self.assertEqual(
|
||||
json.dumps({'lang': ugettext_lazy("French")}, cls=DjangoJSONEncoder),
|
||||
json.dumps({'lang': gettext_lazy("French")}, cls=DjangoJSONEncoder),
|
||||
'{"lang": "French"}'
|
||||
)
|
||||
with override('fr'):
|
||||
self.assertEqual(
|
||||
json.dumps({'lang': ugettext_lazy("French")}, cls=DjangoJSONEncoder),
|
||||
json.dumps({'lang': gettext_lazy("French")}, cls=DjangoJSONEncoder),
|
||||
'{"lang": "Fran\\u00e7ais"}'
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue