view MoinMoin/auth/_tests/test_log.py @ 1974:87272c032485

remove unused imports
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 10 Feb 2013 23:54:13 +0100
parents ff503e7ea7a0
children d06e56e20b91
line wrap: on
line source
# Copyright: 2011 Prashant Kumar <contactprashantat AT gmail DOT com>
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

"""
Test for auth.log
"""

from MoinMoin import log
logging = log.getLogger(__name__)

from MoinMoin.auth.log import AuthLog
from flask import g as flaskg


class TestAuthLog(object):
    """ Test: TestAuthLog """
    def test_login(self):
        authlog_obj = AuthLog()
        result = authlog_obj.login(flaskg.user)
        assert result.continue_flag
        test_user_obj = result.user_obj
        assert test_user_obj.name0 == u'anonymous'

    def test_request(self):
        authlog_obj = AuthLog()
        result = authlog_obj.request(flaskg.user)
        test_user, bool_value = result
        assert test_user.name0 == u'anonymous'
        assert not test_user.valid
        assert bool_value

    def test_logout(self):
        authlog_obj = AuthLog()
        result = authlog_obj.logout(flaskg.user)
        test_user, bool_value = result
        assert test_user.name0 == u'anonymous'
        assert not test_user.valid
        assert bool_value