Example #1
0
File: tests.py Project: rtpg/tock
 def test_project_timeline(self):
     res = project_timeline(self.project)
     self.assertEqual(res['periods'], self.dates)
     self.assertEqual(
         res['groups'],
         {
             self.user: {
                 obj.timecard.reporting_period.start_date: obj.hours_spent
                 for obj in self.objs
             }
         },
     )
Example #2
0
File: tests.py Project: rtpg/tock
 def test_project_timeline(self):
     res = project_timeline(self.project)
     self.assertEqual(res['periods'], self.dates)
     self.assertEqual(
         res['groups'],
         {
             self.user: {
                 obj.timecard.reporting_period.start_date: obj.hours_spent
                 for obj in self.objs
             }
         },
     )
Example #3
0
 def test_project_timeline_no_limit(self):
     res = project_timeline(self.project, period_limit=None)
     self.assertEqual(res['periods'], self.dates)
     self.assertEqual(len(list(res['groups'].values())[0]), len(self.objs))
Example #4
0
 def test_project_timeline_diff_limit(self):
     limit = 8
     res = project_timeline(self.project, period_limit=limit)
     self.assertEqual(res['periods'], self.dates[-limit:])
     self.assertEqual(len(list(res['groups'].values())[0]), limit)
Example #5
0
 def test_project_timeline_no_limit(self):
     res = project_timeline(self.project, period_limit=None)
     self.assertEqual(res['periods'], self.dates)
     self.assertEqual(len(list(res['groups'].values())[0]), len(self.objs))
Example #6
0
 def test_project_timeline_diff_limit(self):
     limit = 8
     res = project_timeline(self.project, period_limit=limit)
     self.assertEqual(res['periods'], self.dates[-limit:])
     self.assertEqual(len(list(res['groups'].values())[0]), limit)