Merge pull request #137 from bgelineau/fix_locale

Fix translations handling.
This commit is contained in:
Juan Ignacio Fiorentino 2016-11-29 17:16:26 -03:00 committed by GitHub
commit 11ef97fdbb
4 changed files with 12 additions and 3 deletions

View file

@ -3,3 +3,4 @@ include README.md
recursive-include oidc_provider/static *
recursive-include oidc_provider/templates *
recursive-include oidc_provider/tests/templates *
recursive-include oidc_provider/locale *

View file

@ -1,6 +1,6 @@
import copy
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy as _
from oidc_provider import settings

View file

@ -1,6 +1,10 @@
from django.test import TestCase
from __future__ import unicode_literals
from oidc_provider.lib.claims import ScopeClaims, STANDARD_CLAIMS
from django.test import TestCase
from django.utils.six import text_type
from django.utils.translation import override as override_language
from oidc_provider.lib.claims import ScopeClaims, StandardScopeClaims, STANDARD_CLAIMS
from oidc_provider.tests.app.utils import create_fake_user, create_fake_client, create_fake_token
@ -54,3 +58,7 @@ class ClaimsTestCase(TestCase):
'email': u'johndoe@example.com'
}
)
def test_locale(self):
with override_language('fr'):
self.assertEqual(text_type(StandardScopeClaims.info_profile[0]), 'Profil de base')