File tree Expand file tree Collapse file tree 2 files changed +0
-21
lines changed
openedx/core/djangoapps/dark_lang Expand file tree Collapse file tree 2 files changed +0
-21
lines changed Original file line number Diff line number Diff line change 1616
1717from openedx .core .djangoapps .dark_lang import DARK_LANGUAGE_KEY
1818from openedx .core .djangoapps .dark_lang .models import DarkLangConfig
19- from openedx .core .djangoapps .site_configuration .helpers import get_value
2019from openedx .core .djangoapps .user_api .preferences .api import get_user_preference
2120
2221# If django 1.7 or higher is used, the right-side can be updated with new-style codes.
@@ -91,17 +90,8 @@ def process_request(self, request):
9190 return
9291
9392 self ._clean_accept_headers (request )
94- self ._set_site_or_microsite_language (request )
9593 self ._activate_preview_language (request )
9694
97- def _set_site_or_microsite_language (self , request ):
98- """
99- Apply language specified in site configuration.
100- """
101- language = get_value ('LANGUAGE_CODE' , None )
102- if language :
103- request .session [LANGUAGE_SESSION_KEY ] = language
104-
10595 def _fuzzy_match (self , lang_code ):
10696 """Returns a fuzzy match for lang_code"""
10797 match = None
Original file line number Diff line number Diff line change 1313
1414from openedx .core .djangoapps .dark_lang .middleware import DarkLangMiddleware
1515from openedx .core .djangoapps .dark_lang .models import DarkLangConfig
16- from openedx .core .djangoapps .site_configuration .tests .test_util import with_site_configuration
1716from openedx .core .djangolib .testing .utils import CacheIsolationTestCase
1817from common .djangoapps .student .tests .factories import UserFactory
1918
@@ -263,16 +262,6 @@ def _set_client_session_language(self, session_language):
263262 session [LANGUAGE_SESSION_KEY ] = session_language
264263 session .save ()
265264
266- @with_site_configuration (configuration = {'LANGUAGE_CODE' : 'rel' })
267- def test_site_configuration_language (self ):
268- # `LANGUAGE_CODE` in site configuration should override session lang
269- self ._set_client_session_language ('notrel' )
270- self .client .get ('/home' )
271- self .assert_session_lang_equals (
272- 'rel' ,
273- self .client .session
274- )
275-
276265 def test_preview_lang_with_released_language (self ):
277266 # Preview lang should always override selection
278267 self ._post_set_preview_lang ('rel' )
You can’t perform that action at this time.
0 commit comments