コード例 #1
0
ファイル: test_dates.py プロジェクト: cmajel/openFEC
    def test_hide_bad_data(self):
        factories.ElectionDateFactory(election_status_id=1)
        factories.ElectionDateFactory(election_status_id=2)

        page = api.url_for(ElectionDatesView)
        results = self._results(page)
        assert len(results) == 1
コード例 #2
0
ファイル: test_dates.py プロジェクト: cmajel/openFEC
 def test_election_type(self):
     election_date = factories.ElectionDateFactory(election_type_id='PR')
     assert election_date.election_type_full == 'Primary runoff'
     election_date = factories.ElectionDateFactory(election_type_id='INVALID')
     assert election_date.election_type_full is None
     election_date = factories.ElectionDateFactory(election_type_id=None)
     assert election_date.election_type_full is None