def assert_row(self, class_, rowobj, desc):
    self.assert_((rowobj.__class__ is class_), ('item class is not ' + repr(class_)))
    for (key, value) in desc.items():
        if isinstance(value, tuple):
            if isinstance(value[1], list):
                self.assert_list(getattr(rowobj, key), value[0], value[1])
            else:
                self.assert_row(value[0], getattr(rowobj, key), value[1])
        else:
            self.assert_((getattr(rowobj, key) == value), ('attribute %s value %s does not match %s' % (key, getattr(rowobj, key), value)))
def assert_row(self, class_, rowobj, desc):
    self.assert_((rowobj.__class__ is class_), ('item class is not ' + repr(class_)))
    for (key, value) in desc.items():
        if isinstance(value, tuple):
            if isinstance(value[1], list):
                self.assert_list(getattr(rowobj, key), value[0], value[1])
            else:
                self.assert_row(value[0], getattr(rowobj, key), value[1])
        else:
            self.assert_((getattr(rowobj, key) == value), ('attribute %s value %s does not match %s' % (key, getattr(rowobj, key), value)))