def _compare(test, db, obj): for field, value in db.items(): # NOTE(danms): The datetimes on SQLA models are tz-unaware, # but the object has tz-aware datetimes. If we're comparing # a model to an object (as opposed to a fake dict), just # ignore the datetimes in the comparison. if (isinstance(db, api_models.API_BASE) and isinstance(value, datetime.datetime)): continue test.assertEqual(db[field], obj[field])
def _compare(test, db, obj, ignored_fields=None): if ignored_fields is None: ignored_fields = [] for field, value in db.items(): if field in ignored_fields: continue obj_field = field if obj_field == 'uuid': obj_field = 'instance_uuid' test.assertEqual(db[field], obj[obj_field], 'Field %s is not equal' % field)
def _compare(test, db, obj, ignored_fields=None): if ignored_fields is None: ignored_fields = [] for field, value in db.items(): if field in ignored_fields: continue obj_field = field if obj_field == 'uuid': obj_field = 'instance_uuid' test.assertEqual(db[field], obj[obj_field], 'Field {0!s} is not equal'.format(field))
def _compare(test, db, obj, ignored_fields=None): if ignored_fields is None: ignored_fields = [] for field, value in db.items(): if field in ignored_fields: continue obj_field = field if obj_field == 'uuid': obj_field = 'instance_uuid' test.assertEqual(db[field], getattr(obj, obj_field), 'Field %s is not equal' % field)
def _compare(test, db, obj): for field, value in db.items(): test.assertEqual(db[field], obj[field])
def _compare(test, db, obj): for field, value in db.items(): test.assertEqual(db[field], getattr(obj, field))
def _compare(test, db, obj): for field, value in db.items(): obj_field = field if obj_field == 'uuid': obj_field = 'instance_uuid' test.assertEqual(db[field], obj[obj_field])
def _compare(test, db, obj): for field, value in db.items(): obj_field = field if obj_field == "uuid": obj_field = "instance_uuid" test.assertEqual(db[field], obj[obj_field])