'This method is a custom assertion verifies that a given user has expected
language code in the preference and in cookies.
Arguments:
user: User model instance
expected_language_code: string indicating a language code'

def assertExpectedLanguageInPreference(self, user, expected_language_code):

    self.assertEqual(get_user_preference(user, LANGUAGE_KEY), expected_language_code)
    self.assertEqual(self.client.cookies[settings.LANGUAGE_COOKIE].value, expected_language_code)
