'For some reasons update_locations can be called directly
(not via image_update), so better check that everything is ok if passed
4 byte unicode characters'

def test_update_locations_direct(self):

    location_data = [{'url': 'a', 'metadata': {'key': 'value'}, 'status': 'active'}]
    fixture = {'locations': location_data}
    image = self.db_api.image_update(self.adm_context, UUID1, fixture)
    self.assertEqual(1, len(image['locations']))
    self.assertIn('id', image['locations'][0])
    loc_id = image['locations'][0].pop('id')
    bad_location = {'url': u'Bad    \U0001f60a', 'metadata': {}, 'status': 'active', 'id': loc_id}
    self.assertRaises(exception.Invalid, self.db_api.image_location_update, self.adm_context, UUID1, bad_location)
