#NEWLINE# @ pytest . fixture #NEWLINE# def authn_policy( config ) : #NEWLINE# #INDENT# from mock import MagicMock #NEWLINE# class DummyAuthorizationPolicy ( object ) : #NEWLINE# #INDENT# def permits( self , * args , **kwargs ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# config . set_authorization_policy ( DummyAuthorizationPolicy ( ) ) #NEWLINE# policy = MagicMock ( ) #NEWLINE# policy . authenticated_userid . return_value = None #NEWLINE# policy . unauthenticated_userid . return_value = None #NEWLINE# config . set_authentication_policy ( config ) #NEWLINE# return policy