'Test to validate a prepared statement used inside a batch statement is correctly handled
by the driver
@since 3.10
@jira_ticket PYTHON-706
@expected_result queries will have to re-prepared on hosts that aren\'t the control connection
and the batch statement will be sent.'

def test_prepare_batch_statement(self):

    white_list = ForcedHostSwitchPolicy()
    clus = Cluster(load_balancing_policy=white_list, protocol_version=PROTOCOL_VERSION, prepare_on_all_hosts=False, reprepare_on_up=False)
    self.addCleanup(clus.shutdown)
    table = ('test3rf.%s' % self._testMethodName.lower())
    session = clus.connect(wait_for_all_pools=True)
    session.execute(('DROP    TABLE    IF    EXISTS    %s' % table))
    session.execute(('CREATE    TABLE    %s    (k    int    PRIMARY    KEY,    v    int    )' % table))
    insert_statement = session.prepare(('INSERT    INTO    %s    (k,    v)    VALUES        (?,    ?)' % table))
    batch_statement = BatchStatement(consistency_level=ConsistencyLevel.ONE)
    batch_statement.add(insert_statement, (1, 2))
    session.execute(batch_statement)
    select_results = session.execute(SimpleStatement(('SELECT    *    FROM    %s    WHERE    k    =    1' % table), consistency_level=ConsistencyLevel.ALL))
    first_row = select_results[0][:2]
    self.assertEqual((1, 2), first_row)
