#NEWLINE# def test_edit_plugin_directly( self ) : #NEWLINE# #INDENT# content0 = self . rand_str ( prefix = 'content0_' ) #NEWLINE# content1 = self . rand_str ( prefix = 'content1_' ) #NEWLINE# content2 = self . rand_str ( prefix = 'content2_' ) #NEWLINE# article = self . create_article ( content = content0 ) #NEWLINE# self . create_revision ( article , content = content1 ) #NEWLINE# self . assertEqual ( len ( default_revision_manager . get_for_object ( article ) ) , 1 ) #NEWLINE# with transaction . atomic ( ) : #NEWLINE# #INDENT# plugins = article . content . get_plugins ( ) #NEWLINE# plugin = plugins [ 0 ] . get_plugin_instance ( ) [ 0 ] #NEWLINE# plugin . body = content2 #NEWLINE# plugin . save ( ) #NEWLINE# aldryn_create_revision ( article ) #NEWLINE# #UNINDENT# self . assertEqual ( len ( default_revision_manager . get_for_object ( article ) ) , 2 ) #NEWLINE# response = self . client . get ( article . get_absolute_url ( ) ) #NEWLINE# self . assertContains ( response , content2 ) #NEWLINE# self . assertNotContains ( response , content1 ) #NEWLINE# self . revert_to ( article , 1 ) #NEWLINE# response = self . client . get ( article . get_absolute_url ( ) ) #NEWLINE# self . assertContains ( response , content1 ) #NEWLINE# self . assertNotContains ( response , content2 )