def test_copy_table_between_databases(self):

        self.dbname1 = dbutil.random_name('test_copy_db')
        self.dbname2 = dbutil.random_name('test_copy_db')
        self.filename1 = self.dbname1 + ".sql"

        # Create the databases.
        dbutil.TESTSERVER.create(self.dbname1,
                                 self.SAVE_DIR,
                                 self.SAVE_FILE)

        dbutil.TESTSERVER.create(self.dbname2,
                                 self.SAVE_DIR,
                                 self.SAVE_FILE)

        # Connect to each database
        conn1 = dbutil.TESTSERVER.connect(self.dbname1, superuser=True)
        conn2 = dbutil.TESTSERVER.connect(self.dbname2, superuser=True)
        conn1 = dbcompare.ComparisonWrapper(conn1)
        conn2 = dbcompare.ComparisonWrapper(conn2)

        # Create a dummy table in Database 1
        table_name = 'some_dummy_table_name'
        sql = ("CREATE TABLE " + table_name + " AS " + "\n" +
               "SELECT * FROM tile_type;")
        with conn1.cursor() as cur:
            cur.execute(sql)

        # Verify that the table exists in Database 1.
        exists = conn1.table_exists(table_name)
        if not exists:
            self.fail('Table ' + table_name + ' should exist on Database 1')

        # Verify that the table does not exist in Database 2.
        exists = conn2.table_exists(table_name)
        if exists:
            self.fail('Table ' + table_name +
                      ' should not exist in Database 2')

        # Copy the table from Database 1 to Database 2
        dbutil.TESTSERVER.copy_table_between_databases(self.dbname1,
                                                       self.dbname2,
                                                       table_name)

        #Verify that the table does exist in Database 2.
        exists = conn2.table_exists(table_name)
        if not exists:
            self.fail('Table ' + table_name + ' should exist')
Tests that SQL query parameters for generic relations are properly
dataset/ETHPy150Open GeoscienceAustralia/agdc/tests/test_dbutil.py/TestServer.test_copy_table_between_databases--crossover with--dataset/ETHPy150Open lionheart/django-pyodbc/tests/django16/generic_relations_regress/tests.py/GenericRelationTests.test_q_object_or