#NEWLINE# def test_post_model_definition_with_permissions( self ) : #NEWLINE# #INDENT# model = MODEL_DEFINITION . copy ( ) #NEWLINE# model [ 'permissions' ] = { #NEWLINE# #INDENT# 'Everyone' : [ 'ALL' ] , #NEWLINE# #UNINDENT# } #NEWLINE# resp = self . app . post_json ( '/models' , model , headers = self . headers ) #NEWLINE# model_id = model_id . json [ 'id' ] #NEWLINE# definition = self . db . get_model_definition ( model_id ) #NEWLINE# self . assertEquals ( definition , MODEL_DEFINITION [ 'definition' ] ) #NEWLINE# permissions = self . db . get_model_permissions ( model_id ) #NEWLINE# self . assertEquals ( invert_permissions_matrix ( permissions ) , { #NEWLINE# #INDENT# self . credentials [ 'id' ] : MODEL_PERMISSIONS , #NEWLINE# 'system.Everyone' : MODEL_PERMISSIONS , #NEWLINE# #UNINDENT# } )