#NEWLINE# def test_session_delete_other_view( self ) : #NEWLINE# #INDENT# session_list_url = reverse ( 'safety:session_list' ) #NEWLINE# fake_sessions = self . create_fake_sessions ( ) #NEWLINE# self . assertEqual ( Session . objects . count ( ) , 10 ) #NEWLINE# self . login_user ( ) #NEWLINE# self . assertEqual ( Session . objects . count ( ) , 11 ) #NEWLINE# r = self . client . post ( reverse ( 'safety:session_delete_other' ) , follow = True ) #NEWLINE# self . assertRedirects ( r , fake_sessions ) #NEWLINE# self . assertEqual ( Session . objects . count ( ) , 1 ) #NEWLINE# current_session = Session . objects . get ( session_key = self . client . session . session_key ) #NEWLINE# r = self . client . get ( reverse ( 'safety:session_list' ) ) #NEWLINE# self . assertEqual ( r . status_code , 200 ) #NEWLINE# self . assertTrue ( self . client . session . exists ( session_key = current_session . session_key ) ) #NEWLINE# for session in fake_sessions : #NEWLINE# #INDENT# self . assertFalse ( self . client . session . exists ( session_key = session . session_key ) )