#NEWLINE# def testClockInBeforeCurrent( self ) : #NEWLINE# #INDENT# '\n        Test that the user cannot clock in with a start time before the active\n        entry\n        ' #NEWLINE# self . login_user ( self . user ) #NEWLINE# entry1_data = { #NEWLINE# #INDENT# 'user' : self . user , #NEWLINE# 'project' : self . project , #NEWLINE# 'activity' : self . devl_activity , #NEWLINE# 'start_time' : self . ten_min_ago , #NEWLINE# #UNINDENT# } #NEWLINE# entry1 = factories . Entry ( ** entry1_data ) #NEWLINE# entry1_data . update ( { #NEWLINE# #INDENT# 'st_str' : self . ten_min_ago . strftime ( '%H:%M:%S' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# before_entry1 = ( entry1 . start_time - relativedelta ( minutes = 5 ) ) #NEWLINE# data = self . clock_in_form #NEWLINE# data . update ( { #NEWLINE# #INDENT# 'start_time_0' : before_entry1 . strftime ( '%m/%d/%Y' ) , #NEWLINE# 'start_time_1' : before_entry1 . strftime ( '%H:%M:%S' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# response = self . client . post ( self . url , data ) #NEWLINE# form = response . context [ 'form' ] #NEWLINE# self . assertEquals ( len ( form . errors ) , 2 , form . errors ) #NEWLINE# self . assertTrue ( ( 'start_time' in form . errors ) , form . errors . keys ) #NEWLINE# self . assertTrue ( ( '__all__' in form . errors ) , form . errors . keys )