'make sure register user call invokes update_user and includes language preference'

@patch('lms.djangoapps.email_marketing.tasks.update_user.delay')
def test_register_user_language_preference(self, mock_update_user):

    self.assertIsNone(self.user.preferences.model.get_value(self.user, LANGUAGE_KEY))
    email_marketing_register_user(None, user=self.user, profile=self.profile)
    self.assertEqual(mock_update_user.call_args[0][0]['ui_lang'], settings.LANGUAGE_CODE)
    self.user.preferences.create(key=LANGUAGE_KEY, value='es-419')
    email_marketing_register_user(None, user=self.user, profile=self.profile)
    self.assertEqual(mock_update_user.call_args[0][0]['ui_lang'], 'es-419')
