#NEWLINE# def test_pf_autoscale_manage_api_edit_admin_bad_post( self ) : #NEWLINE# #INDENT# self . setup_useable_api_call ( ) #NEWLINE# call = self . db . autoscale . find_one ( ) #NEWLINE# with self . app as c : #NEWLINE# #INDENT# with c . session_transaction ( ) as sess : #NEWLINE# #INDENT# self . setup_admin_login ( sess ) #NEWLINE# #UNINDENT# data = { #NEWLINE# #INDENT# 'api_uri' : '{ddi}/groups' , #NEWLINE# 'doc_url' : 'http://docs.rackspace.com' , #NEWLINE# 'short_description' : 'Test API Call' , #NEWLINE# 'title' : 'Test Call' , #NEWLINE# 'verb' : 'GET' , #NEWLINE# 'variables' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# response = c . post ( ( '/autoscale/manage/api/edit/%s' % call . get ( '_id' ) ) , data = data , follow_redirects = True ) #NEWLINE# #UNINDENT# self . assertIn ( 'Form validation error, please check the form and try again' , response . data , 'Incorrect flash message after add bad data' ) #NEWLINE# self . assertIn ( 'Edit API Call' , response . data , 'Invalid HTML found when browsing to edit' ) #NEWLINE# check_call = self . db . autoscale . find_one ( ) #NEWLINE# assert ( call == check_call ) , 'Call was edited when it was not supposed to'