コード例 #1
0
ファイル: tests.py プロジェクト: Dragonite/fishing
    def test_poll_isClosed(self):
        title='test_poll_isClosed -  where is your favorite fishing spot?'
        description='survey to find out the most favorite fishing spot in Perth'
        user=User.query.filter_by(userId=1).first()
 
        minResponses=5 #if not specified, the default value is -1 which will be ignored
        orderCandidatesBy=None #if not specified, the default value is alphabel acending 'Acs'
        isOpenPoll=None #if not specified, the default value is False
        openAt=None #if not specified, the default value is utcnow()
        closeAt=None  # if not specified, the default value is today + 7 days
        poll=Poll(title, description, minResponses, orderCandidatesBy, isOpenPoll, openAt, closeAt, user)
        
        assert_that(poll.isClosed()).is_equal_to(False)
        
        poll.close()

        assert_that(poll.isClosed()).is_equal_to(True)