def testRoundingConversions(self):
        """
        Verify that entries (which are in seconds) approximate a correct hourly value
        once each decimal conversion per entry is summed.
        """
        xtime = timezone.now() - relativedelta(minutes=10)
        factories.Entry(**{
            'user': self.superuser,
            'project': self.p2,
            'start_time': xtime,
            'end_time': xtime + relativedelta(seconds=29)
        })
        factories.Entry(**{
            'user': self.superuser,
            'project': self.p2,
            'start_time': xtime + relativedelta(seconds=30),
            'end_time': xtime + relativedelta(seconds=60)
        })

        self.login_user(self.superuser)
        response = self._get(url_args=(self.p2.pk,))
        entries = response.context['entries']
        self.assertEqual(len(entries), 2)
        self.assertAlmostEqual(sum(Decimal(e['hours']) for e in entries), Decimal(0.016), places=2)
dataset/ETHPy150Open caktus/django-timepiece/timepiece/crm/tests/test_project_timesheet.py/TestProjectTimesheet.testRoundingConversions/original