@responses.activate
    def test_it_should_remove_child_agencies_and_advertisers_when_removing_organization(self):
        self.setup()
        with open('tests/fixtures/permissions.xml') as f:
            fixture = f.read()
        responses.add(responses.GET,
                      'https://api.mediamath.com/api/v2.0/users/10000/permissions',
                      body=fixture,
                      content_type='application/xml',
                      match_querystring=True)

        p = self.t1.get('users', 10000, child='permissions')
        remove_advertiser_ids = [8, 9, 10]
        remove_agency_ids = [4, 5]
        for advertiser_id in remove_advertiser_ids:
            assert p.advertiser.keys() in advertiser_id, 'Expected advertiser {} to be in access flags'.format(advertiser_id)
        for agency_id in remove_agency_ids:
            assert agency_id in p.agency.keys(), 'Expected agency {} to be in access flags'.format(agency_id)

        p.remove('organization', 2)
        for advertiser_id in remove_advertiser_ids:
            assert advertiser_id not in p.advertiser.keys(), 'child advertiser {} should have been removed but is still there'\
                .format(advertiser_id)

        for agency_id in remove_agency_ids:
            assert agency_id not in p.agency.keys(), 'child agency {} should have been removed but is still there'\
                .format(agency_id)
dataset/ETHPy150Open MediaMath/t1-python/tests/test_permissions.py/TestPermissions.test_it_should_remove_child_agencies_and_advertisers_when_removing_organization/swapped operands of `in`