#NEWLINE# def test_update_new_instance_of_the_resource_with_content_type_text_xml( self ) : #NEWLINE# #INDENT# an_updated_item = '<comment id="2">meu comentario</comment>' #NEWLINE# response = self . _fetch ( self . get_url ( '/api/2' ) , 'PUT' , headers = { #NEWLINE# #INDENT# 'Content-Type' : 'text/xml' , #NEWLINE# #UNINDENT# } , body = an_updated_item ) #NEWLINE# assert_response_code ( response , 204 ) #NEWLINE# response = self . _fetch ( response . headers [ 'Location' ] , 'GET' , headers = { #NEWLINE# #INDENT# 'Accept' : 'text/xml' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( 'text/xml' in response . headers [ 'Content-Type' ] ) , 'the content-type should be text/xml but it was {0}' . format ( response . headers [ 'Content-Type' ] ) #NEWLINE# doc = ElementTree . fromstring ( response . body ) #NEWLINE# assert ( doc . tag == 'comment' ) , 'the tag should be "comment" but it was {0}' . format ( doc . tag ) #NEWLINE# assert ( doc . text == 'meu comentario' ) , 'the comment text should be "meu comentario" but it was {0}' . format ( an_updated_item . text )