#NEWLINE# def test_user_accepted_terms_and_conduct( self ) : #NEWLINE# #INDENT# 'Test that posting a valid form updates user and redirects.' #NEWLINE# user = self . create_user ( tos_accepted_at = None , ucoc_accepted_at = None ) #NEWLINE# self . assertIsNone ( user . tos_accepted_at ) #NEWLINE# self . assertIsNone ( user . ucoc_accepted_at ) #NEWLINE# self . client . login ( username = user . email , password = 'moo' ) #NEWLINE# response = self . client . post ( reverse ( 'accept_terms_and_conduct' ) , { #NEWLINE# #INDENT# 'accept_tos' : True , #NEWLINE# 'accept_ucoc' : True , #NEWLINE# 'next' : '/?ok' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertRedirects ( response , '/?ok' , target_status_code = 302 ) #NEWLINE# user = User . objects . get ( pk = user . pk ) #NEWLINE# self . assertIsInstance ( user . tos_accepted_at , datetime ) #NEWLINE# self . assertIsInstance ( user . ucoc_accepted_at , datetime )