Ejemplo n.º 1
0
 def test_by_size(self):
     [
         factories.ScheduleABySizeFactory(
             committee_id=self.committees[0].committee_id,
             cycle=2012,
             total=50,
             size=200,
         ),
         factories.ScheduleABySizeFactory(
             committee_id=self.committees[1].committee_id,
             cycle=2012,
             total=150,
             size=200,
         ),
     ]
     results = self._results(
         api.url_for(
             ScheduleABySizeCandidateView,
             candidate_id=self.candidate.candidate_id,
             cycle=2012,
         ))
     self.assertEqual(len(results), 1)
     expected = {
         'candidate_id': self.candidate.candidate_id,
         'cycle': 2012,
         'total': 200,
         'size': 200,
     }
     self.assertEqual(results[0], expected)
Ejemplo n.º 2
0
 def test_by_size(self):
     [
         factories.ScheduleABySizeFactory(
             committee_id=self.committees[0].committee_id,
             cycle=2012,
             total=50,
             size=200,
             count=20,
         ),
         factories.ScheduleABySizeFactory(
             committee_id=self.committees[1].committee_id,
             cycle=2012,
             total=150,
             size=200,
             count=20,
         ),
     ]
     results = self._results(
         api.url_for(
             ScheduleABySizeCandidateView,
             candidate_id=self.candidate.candidate_id,
             cycle=2012,
         ))
     assert len(results) == 1
     expected = {
         'candidate_id': self.candidate.candidate_id,
         'cycle': 2012,
         'total': 200,
         'size': 200,
         'count': 20,
     }
     assert results[0] == expected