'Tests that masquerading as a specific user for the course does not update preference language
for the staff.
Login as a staff user and set user\'s language preference to english and visit the courseware page.
Set masquerade to view same page as a specific student having different language preference and
revisit the courseware page.'

def test_masquerading_with_language_preference(self):

    english_language_code = 'en'
    set_user_preference(self.test_user, preference_key=LANGUAGE_KEY, preference_value=english_language_code)
    self.login_staff()
    self.get_courseware_page()
    self.assertExpectedLanguageInPreference(self.test_user, english_language_code)
    set_user_preference(self.student_user, preference_key=LANGUAGE_KEY, preference_value='es-419')
    self.update_masquerade(role='student', user_name=self.student_user.username)
    self.get_courseware_page()
    self.assertExpectedLanguageInPreference(self.test_user, english_language_code)
