Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin._tests.test_PageEditor.TestSave Class Reference

List of all members.

Public Member Functions

def setup_method
def teardown_method
def testSaveAbort

Public Attributes

 old_handlers

Detailed Description

Definition at line 163 of file test_PageEditor.py.


Member Function Documentation

Definition at line 165 of file test_PageEditor.py.

00165 
00166     def setup_method(self, method):
00167         self.old_handlers = self.request.cfg.event_handlers
00168         become_trusted(self.request)

Definition at line 169 of file test_PageEditor.py.

00169 
00170     def teardown_method(self, method):
00171         self.request.cfg.event_handlers = self.old_handlers
00172         nuke_page(self.request, u'AutoCreatedMoinMoinTemporaryTestPageFortestSave')

Here is the call graph for this function:

Test if saveText() is interrupted if PagePreSave event handler returns Abort

Definition at line 173 of file test_PageEditor.py.

00173 
00174     def testSaveAbort(self):
00175         """Test if saveText() is interrupted if PagePreSave event handler returns Abort"""
00176 
00177         def handler(event):
00178             from MoinMoin.events import Abort
00179             return Abort("This is just a test")
00180 
00181         pagename = u'AutoCreatedMoinMoinTemporaryTestPageFortestSave'
00182         testtext = u'ThisIsSomeStupidTestPageText!'
00183 
00184         self.request.cfg.event_handlers = [handler]
00185 
00186         page = Page(self.request, pagename)
00187         if page.exists():
00188             deleter = PageEditor(self.request, pagename)
00189             deleter.deletePage()
00190 
00191         editor = PageEditor(self.request, pagename)
00192         editor.saveText(testtext, 0)
00193 
00194         print "PageEditor can't save a page if Abort is returned from PreSave event handlers"
00195         page = Page(self.request, pagename)
00196         assert page.body != testtext
00197 

Here is the call graph for this function:


Member Data Documentation

Definition at line 166 of file test_PageEditor.py.


The documentation for this class was generated from the following file: