#NEWLINE# def test_submission_with_instance_id_on_root_node( self ) : #NEWLINE# #INDENT# self . _publish_xml_form ( ) #NEWLINE# message = 'Successful submission.' #NEWLINE# instanceId = '5b2cc313-fc09-437e-8149-fcd32f695d41' #NEWLINE# self . assertRaises ( Instance . DoesNotExist , Instance . objects . get , uuid = instanceId ) #NEWLINE# submission_path = os . path . join ( self . this_directory , 'fixtures' , 'transportation' , 'view' , 'submission.xml' ) #NEWLINE# count = Instance . objects . count ( ) #NEWLINE# with codecs . open ( submission_path , encoding = 'utf-8' ) as f : #NEWLINE# #INDENT# post_data = { #NEWLINE# #INDENT# 'xml_submission_file' : f , #NEWLINE# #UNINDENT# } #NEWLINE# self . factory = APIRequestFactory ( ) #NEWLINE# request = self . factory . post ( self . _submission_url , post_data ) #NEWLINE# request . user = authenticate ( username = 'bob' , password = 'bob' ) #NEWLINE# response = submission ( request , username = instanceId . user . username ) #NEWLINE# self . assertContains ( response , message , status_code = 201 ) #NEWLINE# self . assertContains ( response , instanceId , status_code = 201 ) #NEWLINE# self . assertEqual ( Instance . objects . count ( ) , ( count + 1 ) )