#NEWLINE# def test_error_create_unauthorized( client ) : #NEWLINE# #INDENT# response = helpers . request ( client , 'POST' , '/widgets?user_id=bar' , { #NEWLINE# #INDENT# 'owner_id' : 'foo' , #NEWLINE# 'name' : 'Created' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( response . status_code == 403 ) #NEWLINE# assert ( helpers . get_errors ( client ) == [ { #NEWLINE# #INDENT# 'code' : 'invalid_user' , #NEWLINE# #UNINDENT# } ] )