#NEWLINE# def testClockOutOverlap( self ) : #NEWLINE# #INDENT# '\n        Test that the user cannot clock out if the times overlap with an\n        existing entry\n        ' #NEWLINE# now = ( timezone . now ( ) - relativedelta ( hours = 5 ) ) #NEWLINE# entry1_data = { #NEWLINE# #INDENT# 'user' : self . user , #NEWLINE# 'project' : self . project , #NEWLINE# 'activity' : self . devl_activity , #NEWLINE# 'start_time' : now , #NEWLINE# 'end_time' : self . default_end_time , #NEWLINE# #UNINDENT# } #NEWLINE# entry1 = factories . Entry ( ** entry1_data ) #NEWLINE# entry1_data . update ( { #NEWLINE# #INDENT# 'st_str' : entry1 . start_time . strftime ( '%H:%M:%S' ) , #NEWLINE# 'end_str' : entry1 . end_time . strftime ( '%H:%M:%S' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# bad_start = ( entry1 . start_time - relativedelta ( hours = 1 ) ) #NEWLINE# bad_end = ( entry1 . end_time + relativedelta ( hours = 1 ) ) #NEWLINE# factories . Entry ( user = self . user , start_time = bad_start , end_time = bad_end ) #NEWLINE# data = { #NEWLINE# #INDENT# 'start_time_0' : bad_start . strftime ( '%m/%d/%Y' ) , #NEWLINE# 'start_time_1' : bad_start . strftime ( '%H:%M:%S' ) , #NEWLINE# 'end_time_0' : bad_end . strftime ( '%m/%d/%Y' ) , #NEWLINE# 'end_time_1' : bad_end . strftime ( '%H:%M:%S' ) , #NEWLINE# 'location' : self . location . pk , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( reverse ( 'clock_out' ) , data ) #NEWLINE# form = response . context [ 'form' ] #NEWLINE# self . assertEquals ( len ( form . errors ) , 1 , form . errors . keys ) #NEWLINE# self . assertTrue ( ( '__all__' in form . errors ) , form . errors )