def testClockInBlock(self):
        self.login_user(self.user)
        entry1_data = {
            'user': self.user,
            'project': self.project,
            'activity': self.devl_activity,
            'start_time': self.ten_min_ago,
            'end_time': self.now,
        }
        entry1 = factories.Entry(**entry1_data)
        entry1_data.update({
            'st_str': self.ten_min_ago.strftime('%H:%M:%S'),
            'end_str': self.now.strftime('%H:%M:%S'),
        })
        blocked_start_time = entry1.start_time + relativedelta(minutes=5)
        data = self.clock_in_form
        data.update({
            'start_time_0': blocked_start_time.strftime('%m/%d/%Y'),
            'start_time_1': blocked_start_time.strftime('%H:%M:%S'),
        })
        # This clock in attempt should be blocked by entry1
        response = self.client.post(self.url, data)
        form = response.context['form']
        self.assertEquals(len(form.errors), 1, form.errors)
        self.assertTrue('__all__' in form.errors, form.errors.keys())
The user cannot clock in to a time that is already logged
dataset/ETHPy150Open caktus/django-timepiece/timepiece/entries/tests/test_timesheet.py/ClockInTest.testClockInBlock