Changeset 5908 for main/waeup.sirp/trunk


Ignore:
Timestamp:
1 Apr 2011, 14:21:03 (14 years ago)
Author:
uli
Message:

Check whether the disabled attribute of accesscodes is respected
during authentication.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_authentication.py

    r5897 r5908  
    4949
    5050class FakeAccessCode(object):
    51     def __init__(self, repr, inv_date=None):
     51    def __init__(self, repr, inv_date=None, disabled=False):
    5252        self.invalidation_date = inv_date
    5353        self.representation = repr
     54        self.disabled = disabled
    5455
    5556class FakeInvAccessCode(object):
     
    8788                    'APP-44444': FakeAccessCode('APP-44444', True),
    8889                    'APP-55555': FakeAccessCode('APP-55555', True),
     90                    'APP-66666': FakeAccessCode('APP-66666', True, False),
     91                    'APP-77777': FakeAccessCode('APP-77777', False, False),
    8992                    })
    9093            }
     
    131134        result = self.plugin.authenticateCredentials(
    132135            dict(accesscode='APP-55555'))
     136        assert result is None
     137
     138        result = self.plugin.authenticateCredentials(
     139            dict(accesscode='APP-66666'))
     140        assert result is None
     141
     142        result = self.plugin.authenticateCredentials(
     143            dict(accesscode='APP-77777'))
    133144        assert result is None
    134145        return
Note: See TracChangeset for help on using the changeset viewer.