'Tests that referred table is reported accurately'

def test_constraint_references(self):

    main_table = 'test_cns_ref'
    reference_table = 'test_cr_foreign'
    db.start_transaction()
    self._create_foreign_tables(main_table, reference_table)
    db.execute_deferred_sql()
    constraint = db._find_foreign_constraints(main_table, 'foreign_id')[0]
    references = db._lookup_constraint_references(main_table, constraint)
    self.assertEquals((reference_table, 'id'), references)
    db.delete_table(main_table)
    db.delete_table(reference_table)
