def testResubmitForOtherStatuses(self): # set status of the proposal to accepted self.proposal.status = proposal_model.STATUS_ACCEPTED self.proposal.put() # it should not be possible to resubmit this proposal can_resubmit = proposal_logic.canProposalBeResubmitted( self.proposal, self.student, self.program, self.timeline) self.assertFalse(can_resubmit) # set status of the proposal to ignored self.proposal.status = proposal_model.STATUS_IGNORED self.proposal.put() # it should not be possible to resubmit this proposal can_resubmit = proposal_logic.canProposalBeResubmitted( self.proposal, self.student, self.program, self.timeline) self.assertFalse(can_resubmit) # set status of the proposal to invalid self.proposal.status = proposal_model.STATUS_INVALID self.proposal.put() # it should not be possible to resubmit this proposal can_resubmit = proposal_logic.canProposalBeResubmitted( self.proposal, self.student, self.program, self.timeline) self.assertFalse(can_resubmit) # set status of the proposal to pending self.proposal.status = proposal_model.STATUS_PENDING self.proposal.put() # it should not be possible to resubmit this proposal can_resubmit = proposal_logic.canProposalBeResubmitted( self.proposal, self.student, self.program, self.timeline) self.assertFalse(can_resubmit) # set status of the proposal to rejected self.proposal.status = proposal_model.STATUS_REJECTED self.proposal.put() # it should not be possible to resubmit this proposal can_resubmit = proposal_logic.canProposalBeResubmitted( self.proposal, self.student, self.program, self.timeline) self.assertFalse(can_resubmit)
def testAfterStudentAppPeriod(self): # move the student app period to the future self.timeline.student_signup_end = timeline_utils.past() self.timeline.put() # it should still be possible to resubmit this proposal can_resubmit = proposal_logic.canProposalBeResubmitted( self.proposal, self.student, self.program, self.timeline) self.assertTrue(can_resubmit)
def testForStudentWithMaxProposals(self): # change the student so that max proposals are already submitted self.student.student_data.number_of_proposals = ( self.program.apps_tasks_limit) self.student.put() # it should not be possible to resubmit this proposal can_resubmit = proposal_logic.canProposalBeResubmitted( self.proposal, self.student, self.program, self.timeline) self.assertFalse(can_resubmit)
def testAfterAcceptedStudentsAnnounced(self): """Tests that proposal cannot be resubmitted after announcing students.""" # move the student app period to the future self.timeline.student_signup_end = timeline_utils.past() self.timeline.accepted_students_announced_deadline = timeline_utils.past() self.timeline.put() # it should not be possible to resubmit this proposal can_resubmit = proposal_logic.canProposalBeResubmitted( self.proposal, self.student, self.program, self.timeline) self.assertFalse(can_resubmit)
def testAfterAcceptedStudentsAnnounced(self): """Tests that proposal cannot be resubmitted after announcing students.""" # move the student app period to the future self.timeline.student_signup_end = timeline_utils.past() self.timeline.accepted_students_announced_deadline = timeline_utils.past( ) self.timeline.put() # it should not be possible to resubmit this proposal can_resubmit = proposal_logic.canProposalBeResubmitted( self.proposal, self.student, self.program, self.timeline) self.assertFalse(can_resubmit)
def testResubmitWithdrawnProposal(self): # it should be possible to resubmit this proposal can_resubmit = proposal_logic.canProposalBeResubmitted( self.proposal, self.student, self.program, self.timeline) self.assertTrue(can_resubmit)