Beispiel #1
0
 def test_get_client_summary_per_project_limit2(self):
     # Tests that hours are reported when from_date is equal to from_date of
     # a projectassoc period.
     report = TimeLog.get_client_summary_per_project(self.client,
                                                     date(2010, 9, 16),
                                                     date(2010, 9, 18),
                                                     True)
     expected = {u'FP10': [(u'user1', Decimal('13.500'), Decimal('0.00')),
                           (u'user2', Decimal('19.500'), Decimal('0.00'))]
                 }
     self.assertEqual(expected, report)
Beispiel #2
0
 def test_get_client_summary_per_project_all_hours1(self):
     # Tests that ALL hours are reported, including those with rate 0, that
     # is, hours logged within a projectassoc period with rate 0, and hours
     # logged in days not contained by any projectassoc period.
     report = TimeLog.get_client_summary_per_project(self.client,
                                                     date(2010, 9, 01),
                                                     date(2012, 5, 10),
                                                     True)
     expected = {u'FP42': [(u'user1', Decimal('60.000'), Decimal('0.00')),
                           (u'user1', Decimal('360.000'), Decimal('0.80')),
                           (u'user2', Decimal('157.500'), Decimal('0.60'))],
                 u'FP10': [(u'user1', Decimal('71.000'), Decimal('0.00')),
                           (u'user2', Decimal('97.500'), Decimal('0.00'))]
                 }
     self.assertEqual(expected, report)
Beispiel #3
0
 def test_get_client_summary_per_project_all_hours2(self):
     # Same as previous test, plus tests all works fine with a projassoc
     # with to_date not set.
     report = TimeLog.get_client_summary_per_project(self.client,
                                                     date(2008, 01, 01),
                                                     date(2012, 05, 10),
                                                     True)
     expected = {u'FP42': [(u'user1', Decimal('60.000'), Decimal('0.00')),
                           (u'user1', Decimal('360.000'), Decimal('0.80')),
                           (u'user2', Decimal('157.500'), Decimal('0.60')),
                           (u'user2', Decimal('60.000'), Decimal('0.30')),
                           ],
                 u'FP10': [(u'user1', Decimal('71.000'), Decimal('0.00')),
                           (u'user2', Decimal('97.500'), Decimal('0.00'))]
                 }
     self.assertEqual(expected, report)
Beispiel #4
0
    def test_get_client_summary_per_project_limit1(self):
        # Tests that hours are reported when from_date is equal to to_date of
        # a projectassoc period.
        report = TimeLog.get_client_summary_per_project(self.client,
                                                        date(2010, 9, 30),
                                                        date(2010, 10, 2),
                                                        True)
        expected = {u'FP42': [(u'user1', Decimal('5.000'), Decimal('0.00')),
                              (u'user1', Decimal('16.000'), Decimal('0.80')),
                              (u'user2', Decimal('7.000'), Decimal('0.60'))
                              ],
                    u'FP10': [(u'user1', Decimal('8.000'), Decimal('0.00')),
                              (u'user2', Decimal('6.500'), Decimal('0.00'))]
                    }

        self.assertEqual(expected, report)