Merge pull request #15502 from edx/LEARNER-1298-LEARNER-1299-send-ui-lang-to-sailthru
Set ui_lang in Sailthru when creating and updating users
This commit is contained in:
@@ -232,7 +232,11 @@ class TestUserPreferenceMiddleware(TestCase):
|
||||
|
||||
self.assertEqual(get_user_preference(self.user, LANGUAGE_KEY), None)
|
||||
|
||||
with self.assertNumQueries(5):
|
||||
# The 'email_marketing' app is installed in the LMS env but not the CMS env. It listens for the
|
||||
# USER_FIELD_CHANGED signal (utils.model_utils) and does a query to check the EmailMarketingConfiguration
|
||||
# table to see if Sailthru integreation is enabled.
|
||||
expected_queries = 6 if 'email_marketing' in settings.INSTALLED_APPS else 5
|
||||
with self.assertNumQueries(expected_queries):
|
||||
self.middleware.process_request(self.request)
|
||||
|
||||
self.assertEqual(get_user_preference(self.user, LANGUAGE_KEY), 'es')
|
||||
@@ -258,7 +262,11 @@ class TestUserPreferenceMiddleware(TestCase):
|
||||
|
||||
self.request.COOKIES[settings.LANGUAGE_COOKIE] = 'en'
|
||||
|
||||
with self.assertNumQueries(5):
|
||||
# The 'email_marketing' app is installed in the LMS env but not the CMS env. It listens for the
|
||||
# USER_FIELD_CHANGED signal (utils.model_utils) and does a query to check the EmailMarketingConfiguration
|
||||
# table to see if Sailthru integreation is enabled.
|
||||
expected_queries = 6 if 'email_marketing' in settings.INSTALLED_APPS else 5
|
||||
with self.assertNumQueries(expected_queries):
|
||||
self.middleware.process_request(self.request)
|
||||
|
||||
self.assertEqual(get_user_preference(self.user, LANGUAGE_KEY), 'en')
|
||||
|
||||
Reference in New Issue
Block a user