'Tests that batch deletes with if_exists work, and throw proper LWTException when they are are not applied
@since 3.1
@jira_ticket PYTHON-432
@expected_result Deletes will be preformed if they exist, otherwise throw LWTException
@test_category object_mapper'

@unittest.skipUnless((PROTOCOL_VERSION >= 2), 'only    runs    against    the    cql3    protocol    v2.0')
def test_batch_delete_if_exists_success(self):

    id = uuid4()
    m = TestIfExistsModel.create(id=id, count=8, text='123456789')
    with BatchQuery() as b:
        m.batch(b).if_exists().delete()
    q = TestIfExistsModel.objects(id=id)
    self.assertEqual(len(q), 0)
    with self.assertRaises(LWTException) as assertion:
        with BatchQuery() as b:
            m = TestIfExistsModel(id=uuid4(), count=42)
            m.batch(b).if_exists().delete()
    self.assertEqual(assertion.exception.existing, {'[applied]': False})
