Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
  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)
Ejemplo n.º 3
0
  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)
Ejemplo n.º 4
0
    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)
Ejemplo n.º 5
0
  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)
Ejemplo n.º 6
0
    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)
Ejemplo n.º 7
0
  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)
Ejemplo n.º 8
0
    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)
Ejemplo n.º 9
0
 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)
Ejemplo n.º 10
0
 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)