'Test that eventing of language proficiencies, which happens update_account_settings method, behaves correctly.'

def test_language_proficiency_eventing(self):

    def verify_event_emitted(new_value, old_value):
        '\n                                                Confirm    that    the    user    setting    event    was    properly    emitted\n                                                '
        update_account_settings(self.user, {'language_proficiencies': new_value})
        self.assert_user_setting_event_emitted(setting='language_proficiencies', old=old_value, new=new_value)
        self.reset_tracker()
    verify_event_emitted([{'code': 'en'}], [])
    verify_event_emitted([{'code': 'en'}, {'code': 'fr'}], [{'code': 'en'}])
    verify_event_emitted([{'code': 'en'}, {'code': 'fr'}], [{'code': 'en'}, {'code': 'fr'}])
    verify_event_emitted([], [{'code': 'en'}, {'code': 'fr'}])
