def test_get_list_filter_by_level(self): level = 'precinct' # Make sure there's at least one result at this level if Result.objects(reporting_level=level).count() == 0: candidate = Candidate.objects()[0] contest = candidate.contest ResultFactory(candidate=candidate, contest=contest, reporting_level=level) data = self.roller.get_list(state="MD", reporting_level=level) self.assertEqual(len(data), Result.objects(state="MD", reporting_level=level).count())
def test_get_list_filter_by_level(self): level = 'precinct' # Make sure there's at least one result at this level if Result.objects(reporting_level=level).count() == 0: candidate = Candidate.objects()[0] contest = candidate.contest ResultFactory(candidate=candidate, contest=contest, reporting_level=level) data = self.roller.get_list(state="MD", reporting_level=level) self.assertEqual( len(data), Result.objects(state="MD", reporting_level=level).count())
def test_get_list(self): data = self.roller.get_list(state='md', datefilter='20121106', type='general') self.assertNotEqual(len(data), 0) self.assertEqual( len(data), Result.objects( election_id__contains='md-2012-11-06-general').count())
def test_get_list(self): data = self.roller.get_list(state='md', datefilter='20121106', type='general') self.assertNotEqual(len(data), 0) self.assertEqual(len(data), Result.objects(election_id__contains='md-2012-11-06-general').count())