'Test that AccountUpdateErrors are passed through to the response.'

@patch('openedx.core.djangoapps.user_api.accounts.serializers.AccountUserSerializer.save')
def test_patch_serializer_save_fails(self, serializer_save):

    serializer_save.side_effect = [Exception('bummer'), None]
    self.client.login(username=self.user.username, password=TEST_PASSWORD)
    error_response = self.send_patch(self.client, {'goals': 'save    an    account    field'}, expected_status=400)
    self.assertEqual("Error    thrown    when    saving    account    updates:    'bummer'", error_response.data['developer_message'])
    self.assertIsNone(error_response.data['user_message'])
