Back to index

moin  1.9.0~rc2
test_Action.py
Go to the documentation of this file.
00001 # -*- coding: utf-8 -*-
00002 """
00003     MoinMoin - MoinMoin.macro.Action Tests
00004 
00005     @copyright: 2007 MoinMoin:ReimarBauer
00006     @license: GNU GPL, see COPYING for details.
00007 """
00008 import os
00009 
00010 from MoinMoin import macro
00011 from MoinMoin.macro import Action
00012 from MoinMoin.Page import Page
00013 from MoinMoin.PageEditor import PageEditor
00014 
00015 from MoinMoin._tests import become_trusted, create_page, make_macro, nuke_page
00016 
00017 class TestAction:
00018     """ testing macro Action calling action raw """
00019     pagename = u'AutoCreatedMoinMoinTemporaryTestPageForAction'
00020 
00021     def testActionCallingRaw(self):
00022         """ module_tested: executes raw by macro Action on existing page"""
00023         request = self.request
00024         become_trusted(request)
00025         self.page = create_page(request, self.pagename, u'= title1 =\n||A||B||\n')
00026         m = make_macro(self.request, self.page)
00027         result = Action.macro_Action(m, 'raw')
00028         nuke_page(request, self.pagename)
00029         expected = '<a class="action" href="/AutoCreatedMoinMoinTemporaryTestPageForAction?action=raw">raw</a>'
00030         assert result == expected
00031 
00032 coverage_modules = ['MoinMoin.macro.Action']
00033