'Tests that referred column in a foreign key (ex. id) is found'

def test_reverse_column_constraint(self):

    main_table = 'test_reverse_ref'
    reference_table = 'test_rr_foreign'
    db.start_transaction()
    self._create_foreign_tables(main_table, reference_table)
    db.execute_deferred_sql()
    inverse = db._lookup_reverse_constraint(reference_table, 'id')
    (cname, rev_table, rev_column) = inverse[0]
    self.assertEquals(main_table, rev_table)
    self.assertEquals('foreign_id', rev_column)
    db.delete_table(main_table)
    db.delete_table(reference_table)
