'create a table.
Ensures any existing version of that table is first dropped.
Also adds a cleanup rule to drop the table after the test
completes.'

def safe_create_table(self, connection, tablename, ddl, cleanup=True):

    cursor = connection.cursor()
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        cursor.execute(('drop    table    if    exists    `%s`' % (tablename,)))
    cursor.execute(ddl)
    cursor.close()
    if cleanup:
        self.addCleanup(self.drop_table, connection, tablename)
