fix: use cookies for storing language instead of session

- Fixed LANGUAGE_COOKIE settings name to LANGUAGE_COOKIE_NAME beacuse later is recognised by django
- Added test to verify cookies use in dark lang middleware
- Fixing Django 3.0 tests
This commit is contained in:
Soban Javed
2021-09-20 17:24:38 +05:00
parent 6ea900cba6
commit 44ddbdf925
12 changed files with 114 additions and 41 deletions

View File

@@ -1080,7 +1080,7 @@ TIME_ZONE = 'UTC'
LANGUAGE_CODE = 'en' # http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGES_BIDI = lms.envs.common.LANGUAGES_BIDI
LANGUAGE_COOKIE = lms.envs.common.LANGUAGE_COOKIE
LANGUAGE_COOKIE_NAME = lms.envs.common.LANGUAGE_COOKIE_NAME
LANGUAGES = lms.envs.common.LANGUAGES
LANGUAGE_DICT = dict(LANGUAGES)

View File

@@ -600,3 +600,5 @@ COURSE_OLX_VALIDATION_IGNORE_LIST = ENV_TOKENS.get(
################# show account activate cta after register ########################
SHOW_ACCOUNT_ACTIVATION_CTA = ENV_TOKENS.get('SHOW_ACCOUNT_ACTIVATION_CTA', SHOW_ACCOUNT_ACTIVATION_CTA)
LANGUAGE_COOKIE_NAME = ENV_TOKENS.get('LANGUAGE_COOKIE', None) or ENV_TOKENS.get('LANGUAGE_COOKIE_NAME')