Changeset 6179 for main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests
- Timestamp:
- 20 May 2011, 22:42:30 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_authentication.py
r6123 r6179 62 62 self.access_code = ac 63 63 64 class FakeSite(grok.Application, grok.Container):65 def __init__(self):66 super(FakeSite, self).__init__()67 self['applicants'] = {68 'APP': {69 'APP-12345': FakeApplication(u'APP-12345'),70 'APP-54321': FakeApplication(u'APP-54321'),71 'APP-22222': FakeApplication(u'APP-OTHER'),72 'APP-44444': FakeApplication(),73 'APP-55555': FakeApplication(u'APP-OTHER'),74 },75 'JAMB': {76 'JAMB1': FakeApplication(),77 'JAMB2': FakeApplication(u'APP-12345'),78 'JAMB3': FakeApplication(u'APP-54321'),79 'JAMB4': FakeApplication(u'APP-44444'),80 },81 }82 self['accesscodes'] = {83 'APP': FakeBatch({84 'APP-12345': FakeAccessCode('APP-12345'),85 'APP-54321': FakeAccessCode('APP-54321', True),86 'APP-11111': FakeAccessCode('APP-11111'),87 'APP-22222': FakeAccessCode('APP-22222'),88 'APP-33333': FakeAccessCode('APP-33333', True),89 'APP-44444': FakeAccessCode('APP-44444', True),90 'APP-55555': FakeAccessCode('APP-55555', True),91 'APP-66666': FakeAccessCode('APP-66666', True, False),92 'APP-77777': FakeAccessCode('APP-77777', False, False),93 })94 }95 96 64 def FakeSite(): 97 65 return { … … 183 151 # Possible cases, where formal correct authentication 184 152 # data is not valid: 185 # XXX: fails186 result = self.plugin.authenticateCredentials(187 dict(accesscode='APP-22222'))188 assert result is None189 190 153 result = self.plugin.authenticateCredentials( 191 154 dict(accesscode='APP-33333')) 192 assert result is None193 194 result = self.plugin.authenticateCredentials(195 dict(accesscode='APP-44444'))196 155 assert result is None 197 156
Note: See TracChangeset for help on using the changeset viewer.