Back to index

moin  1.9.0~rc2
test_admin.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - MoinMoin.userform.admin Tests
00004 
00005     @copyright: 2009 MoinMoin:DmitrijsMilajevs
00006     @license: GNU GPL, see COPYING for details.
00007 """
00008 
00009 
00010 from MoinMoin.userform.admin import do_user_browser
00011 from MoinMoin.datastruct import ConfigGroups
00012 from MoinMoin.user import User
00013 from MoinMoin.Page import Page
00014 from MoinMoin._tests import nuke_user, become_superuser, wikiconfig
00015 
00016 class TestAdmin:
00017 
00018     class Config(wikiconfig.Config):
00019 
00020         def groups(self, request):
00021             groups = {'OneGroup': ['TestUser, OtherUser'],
00022                       'OtherGroup': ['TestUser']}
00023             return ConfigGroups(request, groups)
00024 
00025     def setup_class(self):
00026         request = self.request
00027         user_name = 'TestUser'
00028         self.user_name = user_name
00029 
00030         become_superuser(request)
00031 
00032         User(request, name=user_name, password=user_name).save()
00033 
00034     def teardown_class(self):
00035         nuke_user(self.request, self.user_name)
00036 
00037     def setup_method(self, method):
00038         self.request.page = Page(self.request, 'SystemAdmin')
00039 
00040     def test_do_user_browser(self):
00041         request = self.request
00042 
00043         browser = do_user_browser(request)
00044         assert browser
00045 
00046 
00047 coverage_modules = ['MoinMoin.userform.admin']
00048