view MoinMoin/userform/_tests/test_admin.py @ 4832:f83b7b0b59c4

Groups2009: groups and dicts were merged inside of the datastruct module.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Fri, 03 Jul 2009 16:36:47 +0100
parents 069aac5ce3e4
children 6a7395207387
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.datastruct 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']