#NEWLINE# def test_update( self ) : #NEWLINE# #INDENT# project = self . create_project ( ) #NEWLINE# path = '/api/0/projects/{0}/' . format ( project . id . hex ) #NEWLINE# resp = self . client . post ( path , data = { #NEWLINE# #INDENT# 'name' : 'details test project' , #NEWLINE# 'slug' : 'details-test-project' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( resp . status_code == 401 ) #NEWLINE# self . login_default ( ) #NEWLINE# resp = self . client . post ( path , data = { #NEWLINE# #INDENT# 'name' : 'details test project' , #NEWLINE# 'slug' : 'details-test-project' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( resp . status_code == 403 ) #NEWLINE# self . login_default_admin ( ) #NEWLINE# resp = self . client . post ( path , data = { #NEWLINE# #INDENT# 'name' : 'details test project' , #NEWLINE# 'slug' : 'details-test-project' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( resp . status_code == 200 ) #NEWLINE# project = Project . query . get ( project . id ) #NEWLINE# assert ( project . name == 'details test project' ) #NEWLINE# assert ( project . slug == 'details-test-project' ) #NEWLINE# resp = self . client . post ( path , data = { #NEWLINE# #INDENT# 'status' : 'inactive' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( resp . status_code == 200 ) #NEWLINE# project = Project . query . get ( project . id ) #NEWLINE# assert ( project . status == ProjectStatus . inactive ) #NEWLINE# resp = self . client . post ( path , data = { #NEWLINE# #INDENT# 'status' : 'active' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( resp . status_code == 200 ) #NEWLINE# project = Project . query . get ( project . id ) #NEWLINE# assert ( project . status == ProjectStatus . active )