def test_case_insensitivity(self): committee = factories.CommitteeFactory() committee_id = committee.committee_id factories.CommitteeHistoryFactory(committee_id=committee_id, ) factories.ReportsIEOnlyFactory( committee_id=committee_id, independent_contributions_period=200, independent_expenditures_period=100, ) results = self._results( api.url_for( CommitteeReportsView, committee_id=committee_id.lower(), )) for result in results: self.assertEqual(result["committee_id"], committee_id)
def test_ie_only(self): number = 12345678902 report = factories.ReportsIEOnlyFactory( beginning_image_number=number, independent_contributions_period=200, independent_expenditures_period=100, ) results = self._results( api.url_for( ReportsView, committee_type='ie-only', beginning_image_number=number, )) result = results[0] for key in [ 'report_form', 'independent_contributions_period', 'independent_expenditures_period' ]: self.assertEqual(result[key], getattr(report, key))
def test_ie_committee(self): committee = factories.CommitteeFactory(committee_type='I') committee_id = committee.committee_id factories.CommitteeHistoryFactory( committee_id=committee_id, committee_type='I', ) report = factories.ReportsIEOnlyFactory( committee_id=committee_id, independent_contributions_period=200, independent_expenditures_period=100, ) results = self._results( api.url_for(CommitteeReportsView, committee_id=committee_id,) ) result = results[0] for key in [ 'report_form', 'independent_contributions_period', 'independent_expenditures_period', ]: self.assertEqual(result[key], getattr(report, key))