'Test Batch queries with connections explicitly set
@since 3.7
@jira_ticket PYTHON-613
@expected_result queries should execute appropriately
@test_category object_mapper'

def test_basic_batch_query(self):

    with self.assertRaises(NoHostAvailable):
        with BatchQuery() as b:
            TestModel.objects.batch(b).create(partition=1, cluster=1)
    with BatchQuery(connection='cluster') as b:
        TestModel.objects.batch(b).create(partition=1, cluster=1)
    with ContextQuery(TestModel, connection='cluster') as tm:
        obj = tm.objects.get(partition=1, cluster=1)
        obj.__connection__ = None
    with self.assertRaises(NoHostAvailable):
        with BatchQuery() as b:
            obj.count = 2
            obj.batch(b).save()
    with BatchQuery(connection='cluster') as b:
        obj.count = 2
        obj.batch(b).save()
