def test_present_when_stage_exists_and_is_to_associate_to_existing_deployment(self):
        self.conn.get_rest_apis.return_value = apis_ret
        self.conn.get_deployment.return_value = deployment2_ret
        self.conn.get_deployments.return_value = deployments_ret
        self.conn.get_stage.return_value = stage1_deployment2_ret
        self.conn.update_stage.return_value = stage1_deployment1_ret

        # should never get to the following calls
        self.conn.create_stage.side_effect = ClientError(error_content, 'create_stage')
        self.conn.create_deployment.side_effect = ClientError(error_content, 'create_deployment')

        result = {}
        with TempSwaggerFile() as swagger_file:
            result = salt_states['boto_apigateway.present'](
                        'api present',
                        'unit test api',
                        swagger_file,
                        'test',
                        False,
                        'arn:aws:iam::1234:role/apigatewayrole',
                        **conn_parameters)

        self.assertTrue(result.get('publish'))
        self.assertIs(result.get('result'), True)
        self.assertFalse(result.get('abort'))
        self.assertTrue(result.get('changes', {}).get('new', [{}])[0])
Set AnonymousUser from the database to allow object permissions.
dataset/ETHPy150Open saltstack/salt/tests/unit/states/boto_apigateway_test.py/BotoApiGatewayTestCase.test_present_when_stage_exists_and_is_to_associate_to_existing_deployment--crossover with--dataset/ETHPy150Open kobotoolbox/kobocat/onadata/libs/mixins/anonymous_user_mixin.py/AnonymousUserMixin.get_queryset