示例#1
0
文件: tests.py 项目: 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
             }
         },
     )
示例#2
0
文件: tests.py 项目: 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
             }
         },
     )
示例#3
0
文件: tests.py 项目: isabella232/tock
 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))
示例#4
0
文件: tests.py 项目: isabella232/tock
 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)
示例#5
0
文件: tests.py 项目: Omnipresent/tock
 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))
示例#6
0
文件: tests.py 项目: Omnipresent/tock
 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)