Files
edx-platform/lms/djangoapps/courseware/tests/test_i18n.py
Jesse Zoldak bf3b87bc64 Clean up all modulestore testcases
Move modulestore config for tests to an importable location
Disable pylnt warning for lms imports in common tests
Refactor all testcases that loaded all xml courses
TE-610
TE-489
2014-12-02 07:09:36 -05:00

28 lines
942 B
Python

"""
Tests i18n in courseware
"""
import re
from django.test import TestCase
from django.test.utils import override_settings
from xmodule.modulestore.tests.django_utils import TEST_DATA_MOCK_MODULESTORE
@override_settings(MODULESTORE=TEST_DATA_MOCK_MODULESTORE, LANGUAGES=(('eo', 'Esperanto'),))
class I18nTestCase(TestCase):
"""
Tests for i18n
"""
def test_default_is_en(self):
response = self.client.get('/')
self.assertIn('<html lang="en">', response.content)
self.assertEqual(response['Content-Language'], 'en')
self.assertTrue(re.search('<body.*class=".*lang_en">', response.content))
def test_esperanto(self):
response = self.client.get('/', HTTP_ACCEPT_LANGUAGE='eo')
self.assertIn('<html lang="eo">', response.content)
self.assertEqual(response['Content-Language'], 'eo')
self.assertTrue(re.search('<body.*class=".*lang_eo">', response.content))