Back to index

moin  1.9.0~rc2
test_editbar_actions.py
Go to the documentation of this file.
00001 # -*- coding: utf-8 -*-
00002 """
00003     MoinMoin - MoinMoin.theme Tests
00004 
00005     @copyright: 2008 MoinMoin:ReimarBauer
00006     @license: GNU GPL, see COPYING for details.
00007 """
00008 
00009 from MoinMoin.theme import ThemeBase
00010 from MoinMoin.Page import Page
00011 
00012 class TestEditBarActions(object):
00013     def setup_method(self, method):
00014         self.savedValid = self.request.user.valid
00015         self.savedMailEnabled = self.request.cfg.mail_enabled
00016         self.request.cfg.mail_enabled = True
00017         self.page = Page(self.request, u'FrontPage')
00018         self.ThemeBase = ThemeBase(self.request)
00019 
00020     def teardown_method(self, method):
00021         self.request.user.valid = self.savedValid
00022         self.request.cfg.mail_enabled = self.savedMailEnabled
00023 
00024     def test_editbar_for_anonymous_user(self):
00025         assert not self.request.user.valid
00026         assert not self.ThemeBase.subscribeLink(self.page)
00027         assert not self.ThemeBase.quicklinkLink(self.page)
00028 
00029     def test_editbar_for_valid_user(self):
00030         self.request.user.valid = True
00031         assert self.request.user.valid
00032         assert 'subscribe' in self.ThemeBase.subscribeLink(self.page)
00033         assert 'quicklink' in self.ThemeBase.quicklinkLink(self.page)
00034 
00035 coverage_modules = ['MoinMoin.theme']