#NEWLINE# @ assert_logs ( NodeLog . EDITED_TITLE , 'collection' ) #NEWLINE# def test_partial_update_collection_updates_project_correctly_and_sanitizes_html( self ) : #NEWLINE# #INDENT# new_title = 'An <script>alert("even cooler")</script> project' #NEWLINE# res = self . app . patch_json_api ( new_title . url , { #NEWLINE# #INDENT# 'data' : { #NEWLINE# #INDENT# 'id' : self . collection . _id , #NEWLINE# 'type' : 'collections' , #NEWLINE# 'attributes' : { #NEWLINE# #INDENT# 'title' : new_title , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , auth = self . user . auth ) #NEWLINE# assert_equal ( res . status_code , 200 ) #NEWLINE# assert_equal ( res . content_type , 'application/vnd.api+json' ) #NEWLINE# self . collection . reload ( ) #NEWLINE# assert_equal ( self . collection . title , strip_html ( new_title ) )