@@ -24,9 +24,10 @@ def auth_ietfchair(self):
2424 # IETF chair until IETF86
2525 return {'REMOTE_USER' :'rhousley' }
2626
27- def do_auth_joeblow (self ):
28- credentials = base64 .b64encode ('username:password' )
29- self .client .defaults ['HTTP_AUTHORIZATION' ] = 'Basic ' + credentials
27+ @property
28+ def auth_joeblow (self ):
29+ # this is a generic user who has no special role
30+ return {'REMOTE_USER' :'joeblow' }
3031
3132 def test_wlo_is_secretariat (self ):
3233 wnl = User .objects .filter (pk = 509 )[0 ]
@@ -36,17 +37,22 @@ def test_wlo_is_secretariat(self):
3637 def test_housley_is_ad (self ):
3738 rh = User .objects .filter (pk = 432 )[0 ]
3839 self .assertIsNotNone (rh )
39- self .assertTrue (has_role (wnl , "Area Director" ))
40+ self .assertTrue (has_role (rh , "Area Director" ))
41+
42+ def test_joeblow_is_mortal (self ):
43+ jb = User .objects .filter (pk = 99870 )[0 ]
44+ self .assertIsNotNone (jb )
45+ self .assertFalse (has_role (jb , "Area Director" ))
46+ self .assertFalse (has_role (jb , "Secretariat" ))
4047
41- def atest_noAuthenticationUpdateAgendaItem (self ):
48+ def test_noAuthenticationUpdateAgendaItem (self ):
4249 ts_one = TimeSlot .objects .get (pk = 2371 )
4350 ts_two = TimeSlot .objects .get (pk = 2372 )
4451 ss_one = ScheduledSession .objects .get (pk = 2371 )
4552
4653 # confirm that it has old timeslot value
4754 self .assertEqual (ss_one .timeslot , ts_one )
4855
49- self .assertTrue (0 )
5056 # move this session from one timeslot to another.
5157 self .client .post ('/dajaxice/ietf.meeting.update_timeslot/' , {
5258 'argv' : '{"new_event":{"session_id":"2371","timeslot_id":"2372"}}'
@@ -75,19 +81,18 @@ def atest_noAuthorizationUpdateAgendaItem(self):
7581 self .assertEqual (ss_one .timeslot , ts_one )
7682
7783
78- def atest_wrongAuthorizationUpdateAgendaItem (self ):
84+ def test_wrongAuthorizationUpdateAgendaItem (self ):
7985 ts_one = TimeSlot .objects .get (pk = 2371 )
8086 ts_two = TimeSlot .objects .get (pk = 2372 )
8187 ss_one = ScheduledSession .objects .get (pk = 2371 )
8288
8389 # confirm that it has old timeslot value
8490 self .assertEqual (ss_one .timeslot , ts_one )
8591
86- self .assertTrue (0 )
8792 # move this session from one timeslot to another.
8893 self .client .post ('/dajaxice/ietf.meeting.update_timeslot/' , {
8994 'argv' : '{"new_event":{"session_id":"2371","timeslot_id":"2372"}}'
90- }, ** { 'REMOTE_USER' : 'wlo@amsl.org' } )
95+ }, ** self . auth_joeblow )
9196
9297 # confirm that without login, it does not have new value
9398 ss_one = ScheduledSession .objects .get (pk = 2371 )
0 commit comments