#NEWLINE# def test_document_clear_transformations_view_with_permissions( self ) : #NEWLINE# #INDENT# self . login ( username = TEST_USER_USERNAME , password = TEST_USER_PASSWORD ) #NEWLINE# document_page = self . document . pages . first ( ) #NEWLINE# content_type = ContentType . objects . get_for_model ( document_page ) #NEWLINE# transformation = Transformation . objects . create ( content_type = content_type , object_id = document_page . pk , name = TEST_TRANSFORMATION_NAME , arguments = TEST_TRANSFORMATION_ARGUMENT ) #NEWLINE# self . assertQuerysetEqual ( Transformation . objects . get_for_model ( document_page ) , ( repr ( transformation ) , ) ) #NEWLINE# self . role . permissions . add ( permission_transformation_delete . stored_permission ) #NEWLINE# self . role . permissions . add ( permission_document_view . stored_permission ) #NEWLINE# response = self . post ( 'documents:document_clear_transformations' , args = ( self . document . pk , ) , follow = True ) #NEWLINE# self . assertContains ( content_type , text = 'deleted successfully' , status_code = 200 ) #NEWLINE# self . assertEqual ( Transformation . objects . get_for_model ( document_page ) . count ( ) , 0 )