def test_preexisting_pt(self):
        ptg = self.create_policy_target_group()['policy_target_group']
        pt = self.create_policy_target(
            policy_target_group_id=ptg['id'])['policy_target']
        self.assertTrue('proxy_gateway' in pt)
        self.assertTrue('group_default_gateway' in pt)

        # Forcefully delete the entry in the proxy table, and verify that it's
        # fixed by the subsequent GET
        admin_context = n_ctx.get_admin_context()
        mapping = admin_context.session.query(
            group_proxy_db.ProxyGatewayMapping).filter_by(
                policy_target_id=pt['id']).one()
        admin_context.session.delete(mapping)
        query = admin_context.session.query(
            group_proxy_db.ProxyGatewayMapping).filter_by(
                policy_target_id=pt['id'])
        self.assertRaises(orm_exc.NoResultFound, query.one)

        # Showing the object just ignores the extension
        pt = self.show_policy_target(pt['id'],
                                     expected_res_status=200)['policy_target']
        self.assertFalse(pt in 'proxy_gateway')
        self.assertFalse('group_default_gateway' in pt)

        # Updating the object just ignores the extension
        pt = self.update_policy_target(
            pt['id'], name='somenewname',
            expected_res_status=200)['policy_target']
        self.assertEqual('somenewname', pt['name'])
        self.assertFalse('proxy_gateway' in pt)
        self.assertFalse('group_default_gateway' in pt)
dataset/ETHPy150Open openstack/group-based-policy/gbpservice/neutron/tests/unit/services/grouppolicy/test_group_proxy_extension.py/ExtensionDriverTestCaseMixin.test_preexisting_pt/swapped operands of `in`