#NEWLINE# def test_create_collection_creates_collection_and_sanitizes_html( self ) : #NEWLINE# #INDENT# title = '<em>Cool</em> <script>alert("even cooler")</script> <strong>Project</strong>' #NEWLINE# res = self . app . post_json_api ( self . url , { #NEWLINE# #INDENT# 'data' : { #NEWLINE# #INDENT# 'attributes' : { #NEWLINE# #INDENT# 'title' : title , #NEWLINE# #UNINDENT# } , #NEWLINE# 'type' : 'collections' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , auth = self . user_one . auth ) #NEWLINE# collection_id = res . json [ 'data' ] [ 'id' ] #NEWLINE# assert_equal ( res . status_code , 201 ) #NEWLINE# assert_equal ( res . content_type , 'application/vnd.api+json' ) #NEWLINE# collection = Node . load ( collection_id ) #NEWLINE# assert_equal ( collection . logs [ ( - 1 ) ] . action , NodeLog . PROJECT_CREATED ) #NEWLINE# assert_equal ( collection . title , strip_html ( self ) )