def testClockInAutoOut(self):
        self.login_user(self.user)
        factories.Entry(user=self.user, start_time=self.ten_min_ago)
        data = self.clock_in_form
        data.update({
            'start_time_0': self.now.strftime('%m/%d/%Y'),
            'start_time_1': self.now.strftime('%H:%M:%S'),
        })
        self.client.post(self.url, data)
        entries = Entry.objects.all()
        # These clock in times do not overlap
        for entry in entries:
            if entry.is_overlapping():
                self.fail('Overlapping Times')
        # There is one closed entry and open current entry
        closed_entry = entries.get(end_time__isnull=False)
        current_entry = entries.get(end_time__isnull=True)
        # The current start time is one second after the closed entry's end time
        self.assertEqual(closed_entry.end_time + relativedelta(seconds=1),
                         current_entry.start_time)
Clocking in during an active entry automatically clocks out the current
dataset/ETHPy150Open caktus/django-timepiece/timepiece/entries/tests/test_timesheet.py/ClockInTest.testClockInAutoOut