def testCannotWithdrawAcceptedOrRejectedProposal(self): proposal = proposal_utils.seedProposal( self.student.key, self.program.key(), status=proposal_model.STATUS_ACCEPTED) can_withdraw = proposal_logic.canProposalBeWithdrawn(proposal) # it is not possible to withdraw already accepted proposals self.assertFalse(can_withdraw) proposal.status = proposal_model.STATUS_REJECTED proposal.put() can_withdraw = proposal_logic.canProposalBeWithdrawn(proposal) # it is not possible to withdraw already rejected proposals self.assertFalse(can_withdraw)
def testCanWithdrawPendingProposal(self): proposal = proposal_utils.seedProposal(self.student.key, self.program.key()) can_withdraw = proposal_logic.canProposalBeWithdrawn(proposal) # it should be possible to withdraw a pending proposal self.assertTrue(can_withdraw)
def testCannotWithdrawIgnoredProposal(self): proposal = proposal_utils.seedProposal( self.student.key, self.program.key(), status=proposal_model.STATUS_IGNORED) can_withdraw = proposal_logic.canProposalBeWithdrawn(proposal) # it is not possible to withdraw ignored proposals self.assertFalse(can_withdraw)
def testCannotWithdrawWithdrawnProposals(self): proposal = proposal_utils.seedProposal( self.student.key, self.program.key(), status=proposal_model.STATUS_WITHDRAWN) can_withdraw = proposal_logic.canProposalBeWithdrawn(proposal) # it is not possible to withdraw already withdrawn proposal self.assertFalse(can_withdraw)