

def validate_state(self, columns, *state_table):
    "\n        Validates that the DB contains exactly the values given in the\n        state table. The list of columns is given in the columns tuple.\n\n        Example:\n        self.validate_state(\n            ('a', 'b', 'c'),\n            (1, 2, 3),\n            (11, 12, 13),\n        )\n        validates that the table contains exactly two rows and that\n        their 'a', 'b', and 'c' attributes are 1, 2, 3 for one row and\n        11, 12, 13 for the other row. The order of the rows doesn't\n        matter.\n        "
    current_state = object_list_to_table(columns, self.model.all())[1:]
    if (not equal_lists(current_state, state_table)):
        print('DB state not valid:')
        print('Current state:')
        print(columns)
        for state in current_state:
            print(state)
        print('Should be:')
        for state in state_table:
            print(state)
        self.fail('DB state not valid.')

dataset/ETHPy150Open django-nonrel/djangotoolbox/djangotoolbox/test.py ModelTestCase.validate_state/original