def testClockOutOverlap(self):
        # Create a closed and valid entry
        now = timezone.now() - relativedelta(hours=5)
        entry1_data = {
            'user': self.user,
            'project': self.project,
            'activity': self.devl_activity,
            'start_time': now,
            'end_time': self.default_end_time
        }
        entry1 = factories.Entry(**entry1_data)
        entry1_data.update({
            'st_str': entry1.start_time.strftime('%H:%M:%S'),
            'end_str': entry1.end_time.strftime('%H:%M:%S'),
        })

        # Create a form with times that overlap with entry1
        bad_start = entry1.start_time - relativedelta(hours=1)
        bad_end = entry1.end_time + relativedelta(hours=1)
        factories.Entry(user=self.user, start_time=bad_start, end_time=bad_end)
        data = {
            'start_time_0': bad_start.strftime('%m/%d/%Y'),
            'start_time_1': bad_start.strftime('%H:%M:%S'),
            'end_time_0': bad_end.strftime('%m/%d/%Y'),
            'end_time_1': bad_end.strftime('%H:%M:%S'),
            'location': self.location.pk,
        }
        # With entry1 on either side, a post with the bad_entry data should
        # fail
        response = self.client.post(reverse('clock_out'), data)
        form = response.context['form']
        self.assertEquals(len(form.errors), 1, form.errors.keys)
        self.assertTrue('__all__' in form.errors, form.errors)
Test that the user cannot clock out if the times overlap with an
dataset/ETHPy150Open caktus/django-timepiece/timepiece/entries/tests/test_timesheet.py/ClockOutTest.testClockOutOverlap