Changeset 6452 for main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Timestamp:
- 22 Jun 2011, 13:51:55 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/authentication.py
r6411 r6452 228 228 if ac is None: 229 229 return None 230 if ac. disabled is not False:231 return None 232 if ac. used is not Falseand appl_ac != ac.representation:230 if ac.status == 'disabled': 231 return None 232 if ac.status == 'used' and appl_ac != ac.representation: 233 233 return None 234 234 if appl_ac is not None and appl_ac != ac.representation: -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_authentication.py
r6412 r6452 50 50 51 51 class FakeAccessCode(object): 52 def __init__(self, repr, inv_date=None, disabled=False): 53 self.used = inv_date is not None 52 def __init__(self, repr, status = 'initialized'): 54 53 self.representation = repr 55 self.disabled = disabled 56 57 class FakeInvAccessCode(object): 58 invalidation_date = True 54 self.status = status 59 55 60 56 class FakeApplication(object): … … 71 67 'APP-44444': FakeApplication(), 72 68 'APP-55555': FakeApplication(u'APP-OTHER'), 73 }, 74 'JAMB': { 75 'JAMB1': FakeApplication(), 76 'JAMB2': FakeApplication(u'APP-12345'), 77 'JAMB3': FakeApplication(u'APP-54321'), 78 'JAMB4': FakeApplication(u'APP-44444'), 69 'APP-77777': FakeApplication(u'APP-77777'), 79 70 }, 80 71 }, … … 82 73 'APP': FakeBatch({ 83 74 'APP-12345': FakeAccessCode('APP-12345'), 84 'APP-54321': FakeAccessCode('APP-54321', True),75 'APP-54321': FakeAccessCode('APP-54321', 'used'), 85 76 'APP-11111': FakeAccessCode('APP-11111'), 86 77 'APP-22222': FakeAccessCode('APP-22222'), 87 'APP-33333': FakeAccessCode('APP-33333', True),88 'APP-44444': FakeAccessCode('APP-44444', True),89 'APP-55555': FakeAccessCode('APP-55555', True),90 'APP-66666': FakeAccessCode('APP-66666', True, False),91 'APP-77777': FakeAccessCode('APP-77777', False, False),78 'APP-33333': FakeAccessCode('APP-33333', 'used'), 79 'APP-44444': FakeAccessCode('APP-44444', 'used'), 80 'APP-55555': FakeAccessCode('APP-55555', 'used'), 81 'APP-66666': FakeAccessCode('APP-66666', 'disabled'), 82 'APP-77777': FakeAccessCode('APP-77777', 'disabled'), 92 83 }) 93 84 } … … 166 157 dict(accesscode='APP-77777')) 167 158 assert result is None 159 168 160 return 169 161
Note: See TracChangeset for help on using the changeset viewer.