view MoinMoin/userform/_tests/test_admin.py @ 4823:74216148209d

Groups2009: fix of syntax error for the wikiutil160a.py. Test refinement for the userform.admin
author Dmitrijs Milajevs <dimazest@gmail.com>
date Thu, 25 Jun 2009 15:07:47 +0200
parents 05a605c107ed
children 069aac5ce3e4
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - MoinMoin.userform.admin Tests

    @copyright: 2009 MoinMoin:DmitrijsMilajevs
    @license: GNU GPL, see COPYING for details.
"""


from MoinMoin.userform.admin import do_user_browser
from MoinMoin.groups import ConfigGroups
from MoinMoin.user import User
from MoinMoin.Page import Page
from MoinMoin._tests import nuke_user, become_superuser, wikiconfig

class TestAdmin:

    class Config(wikiconfig.Config):

        def group_manager_init(self, request):
            groups = {'OneGroup': ['TestUser, OtherUser'],
                      'OtherGroup': ['TestUser']}
            return ConfigGroups(request, groups)

    def setup_class(self):
        request = self.request
        user_name = 'TestUser'
        self.user_name = user_name

        become_superuser(request)

        User(request, name=user_name, password=user_name).save()

    def teardown_class(self):
        nuke_user(self.request, self.user_name)

    def setup_method(self, method):
        self.request.page = Page(self.request, 'SystemAdmin')

    def test_do_user_browser(self):
        request = self.request

        browser = do_user_browser(request)
        assert browser


coverage_modules = ['MoinMoin.userform.admin']