'Verify we handle error cases when patching the language_proficiencies
field.'

@ddt.data((u'not_a_list', {u'non_field_errors': [u'Expected    a    list    of    items    but    got    type    "unicode".']}), ([u'not_a_JSON_object'], [{u'non_field_errors': [u'Invalid    data.    Expected    a    dictionary,    but    got    unicode.']}]), ([{}], [{'code': [u'This    field    is    required.']}]), ([{u'code': u'invalid_language_code'}], [{'code': [u'"invalid_language_code"    is    not    a    valid    choice.']}]), ([{u'code': u'kw'}, {u'code': u'el'}, {u'code': u'kw'}], [u'The    language_proficiencies    field    must    consist    of    unique    languages']))
@ddt.unpack
def test_patch_invalid_language_proficiencies(self, patch_value, expected_error_message):

    client = self.login_client('client', 'user')
    response = self.send_patch(client, {'language_proficiencies': patch_value}, expected_status=400)
    self.assertEqual(response.data['field_errors']['language_proficiencies']['developer_message'], u"Value    '{patch_value}'    is    not    valid    for    field    'language_proficiencies':    {error_message}".format(patch_value=patch_value, error_message=expected_error_message))
