Back to index

moin  1.9.0~rc2
test_FootNote.py
Go to the documentation of this file.
00001 # -*- coding: utf-8 -*-
00002 """
00003     MoinMoin - MoinMoin.macro.FootNote Tests
00004 
00005     @copyright: 2008 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 FootNote
00012 from MoinMoin.Page import Page
00013 from MoinMoin.PageEditor import PageEditor
00014 from MoinMoin._tests import become_trusted, create_page, make_macro, nuke_page
00015 
00016 class TestFootNote:
00017     """ testing macro Action calling action raw """
00018     pagename = u'AutoCreatedMoinMoinTemporaryTestPageForFootNote'
00019 
00020     def setup_class(self):
00021         become_trusted(self.request)
00022         self.page = create_page(self.request, self.pagename, u"Foo!")
00023 
00024     def teardown_class(self):
00025         nuke_page(self.request, self.pagename)
00026 
00027     def test_enumbering(self):
00028         """ module_tested: enumbering of Footnotes"""
00029         m = make_macro(self.request, self.page)
00030         text = 'a'
00031         FootNote.execute(m, text)
00032         text = 'b'
00033         FootNote.execute(m, text)
00034         result = FootNote.emit_footnotes(m.request, m.request.formatter)
00035         assert result.endswith('2</a>)</li></ol></div>')
00036 
00037 coverage_modules = ['MoinMoin.macro.FootNote']