Exemplo n.º 1
0
    def test_community_landing_general_time_align_rejection_before_contribution_opens(self):
        """
        This tests that the initial application results.
        Subtests:
         - The applicant is rejected because of 'GENERAL' - they don't meet our eligibility rules
         - The applicant is rejected because of 'TIME' - they don't have 49 out of 91 days free from full-time commitments.
         - The applicant is rejected because of 'ALIGN' - mis-alignment with Outreachy program goals.
        The round is in the initial application period.
        They shouldn't be able to see projects on the community landing page.
        """
        project = self.setup_approved_project_approved_community('initial_applications_open')

        for rejection_reason in ['GENERAL', 'TIME', 'ALIGN', ]:
            with self.subTest(rejection_reason=rejection_reason):
                applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.REJECTED, reason_denied=rejection_reason, application_round=project.project_round.participating_round)
                self.client.force_login(applicant.applicant.account)

                response = self.client.get(reverse('community-landing', kwargs={'round_slug': project.project_round.participating_round.slug, 'community_slug': project.project_round.community.slug}))
                self.assertEqual(response.status_code, 200)
                self.assertContains(response,
                        '<p>If you are an Outreachy applicant, this information will be available once the Outreachy contribution period starts on {} at 4pm UTC. You can sign up for an email notification when the round opens by <a href="https://lists.outreachy.org/cgi-bin/mailman/listinfo/announce">subscribing to the Outreachy announcements mailing list</a>.</p>'.format(date_format(project.project_round.participating_round.contributions_open)),
                        html=True)
                self.assertNotContains(response, '<h1>Outreachy Internships with Debian</h1>', html=True)
                self.assertNotContains(response, '<h1>Open Projects</h1>', html=True)
                self.assertNotContains(response, '<div class="card border" id="debian-{}">'.format(project.slug), html=True)
                self.assertNotContains(response, '<hr id="{}">'.format(project.slug), html=True)
                self.assertNotContains(response, '<h2>{}</h2>'.format(project.short_title), html=True)
Exemplo n.º 2
0
 def create_initial_application(self, current_round):
     applicant_approval = factories.ApplicantApprovalFactory(
         approval_status=models.ApprovalStatus.PENDING,
         application_round=current_round,
     )
     self.create_sensitive_info(applicant_approval)
     return applicant_approval
Exemplo n.º 3
0
    def test_community_landing_general_time_align_rejection_after_contribution_opens(self):
        """
        This tests that the initial application results.
        Subtests:
         - The applicant is rejected because of 'GENERAL' - they don't meet our eligibility rules
         - The applicant is rejected because of 'TIME' - they don't have 49 out of 91 days free from full-time commitments.
         - The applicant is rejected because of 'ALIGN' - mis-alignment with Outreachy program goals.
        The round is in the contribution period.
        They shouldn't be able to see projects on the community landing page.
        """
        project = self.setup_approved_project_approved_community('contributions_open')

        for rejection_reason in ['GENERAL', 'TIME', 'ALIGN', ]:
            with self.subTest(rejection_reason=rejection_reason):
                applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.REJECTED, reason_denied=rejection_reason, application_round=project.project_round.participating_round)
                self.client.force_login(applicant.applicant.account)

                response = self.client.get(reverse('community-landing', kwargs={'round_slug': project.project_round.participating_round.slug, 'community_slug': project.project_round.community.slug}))
                self.assertEqual(response.status_code, 200)
                self.assertContains(response,
                        '<p>This information is only available to applicants who have their initial application approved. Check your <a href="{}">initial application results</a> for more details.</p>'.format(reverse('eligibility-results')),
                        html=True)
                self.assertNotContains(response, '<h1>Outreachy Internships with Debian</h1>', html=True)
                self.assertNotContains(response, '<h1>Open Projects</h1>', html=True)
                self.assertNotContains(response, '<div class="card border" id="debian-{}">'.format(project.slug), html=True)
                self.assertNotContains(response, '<hr id="{}">'.format(project.slug), html=True)
                self.assertNotContains(response, '<h2>{}</h2>'.format(project.short_title), html=True)
Exemplo n.º 4
0
    def test_community_landing_approved_and_pending_before_contribution_opens(self):
        """
        This tests that the initial application results.
        Subtests:
         - The applicant is approved.
         - The applicant is pending.
        The round is in the initial application period.
        They shouldn't be able to see projects on the community landing page.
        """
        project = self.setup_approved_project_approved_community('initial_applications_open')

        for approval_status in [models.ApprovalStatus.APPROVED, models.ApprovalStatus.PENDING, ]:
            with self.subTest(approval_status=approval_status):
                applicant = factories.ApplicantApprovalFactory(approval_status=approval_status, application_round=project.project_round.participating_round)
                self.client.force_login(applicant.applicant.account)

                response = self.client.get(reverse('community-landing', kwargs={'round_slug': project.project_round.participating_round.slug, 'community_slug': project.project_round.community.slug}))
                self.assertEqual(response.status_code, 200)
                self.assertContains(response,
                        '<p>If you are an Outreachy applicant, this information will be available once the Outreachy contribution period starts on {} at 4pm UTC. You can sign up for an email notification when the round opens by <a href="https://lists.outreachy.org/cgi-bin/mailman/listinfo/announce">subscribing to the Outreachy announcements mailing list</a>.</p>'.format(date_format(project.project_round.participating_round.contributions_open)),
                        html=True)
                self.assertNotContains(response, '<h1>Outreachy Internships with Debian</h1>', html=True)
                self.assertNotContains(response, '<h1>Open Projects</h1>', html=True)
                self.assertNotContains(response, '<div class="card border" id="{}">'.format(project.slug), html=True)
                self.assertNotContains(response, '<hr id="{}">'.format(project.slug), html=True)
                self.assertNotContains(response, '<h2>{}</h2>'.format(project.short_title), html=True)
Exemplo n.º 5
0
    def test_contribution_recording_approved_after_contribution_opens(self):
        """
        This tests that the initial application results.
        The applicant is approved.
        The round is in the contribution period.
        They should be able to record a contribution.
        """
        project = self.setup_approved_project_approved_community('contributions_open')

        applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.APPROVED, application_round=project.project_round.participating_round)
        self.client.force_login(applicant.applicant.account)

        response = self.client.get(reverse('contributions-add', kwargs={'round_slug': project.project_round.participating_round.slug, 'community_slug': project.project_round.community.slug, 'project_slug': project.slug }))
        self.assertEqual(response.status_code, 200)
Exemplo n.º 6
0
    def test_applicant_prompts_approved_after_contributions_open(self):
        """
        This tests the applicant prompts in combination with the initial application results.
        The applicant is approved.
        The round is in the contribution period.
        /dashboard/ should show the person is rejected.
        """
        current_round = factories.RoundPageFactory(start_from='contributions_open')
        applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.APPROVED, application_round=current_round)
        self.client.force_login(applicant.applicant.account)

        response = self.client.get(reverse('dashboard'))
        self.assertContains(response, '<div class="card-header text-white bg-warning">A Contribution is Required</div>', html=True)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 7
0
    def test_applicant_prompts_time_rejection_after_contributions_open(self):
        """
        This tests that the initial application results.
        The applicant is rejected because of 'TIME' - they don't have 49 out of 91 days free from full-time commitments.
        The round is in the initial application period.
        /dashboard/ should show the person is rejected.
        """
        current_round = factories.RoundPageFactory(start_from='contributions_open')
        applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.REJECTED, reason_denied='TIME', application_round=current_round)
        self.client.force_login(applicant.applicant.account)

        response = self.client.get(reverse('dashboard'))
        self.assertContains(response, '<div class="card-header text-white bg-warning">Initial Application Not Approved</div>', html=True)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 8
0
    def test_contribution_recording_pending_after_contribution_opens(self):
        """
        This tests that the initial application results.
        The applicant is pending.
        The round is in the contribution period.
        They should NOT be able to record a contribution.
        """
        project = self.setup_approved_project_approved_community('contributions_open')

        applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.PENDING, application_round=project.project_round.participating_round)
        self.client.force_login(applicant.applicant.account)

        response = self.client.get(reverse('contributions-add', kwargs={'round_slug': project.project_round.participating_round.slug, 'community_slug': project.project_round.community.slug, 'project_slug': project.slug }))
        # If an applicant is still under review we direct back to the eligibility results page
        self.assertRedirects(response, reverse('eligibility-results'))
Exemplo n.º 9
0
    def test_initial_application_results_approved_after_contributions_open(self):
        """
        This tests that the initial application results.
        The applicant is approved.
        The round is in the contribution period.
        /eligibility-results/ should show the person is approved.
        """
        current_round = factories.RoundPageFactory(start_from='contributions_open')
        applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.APPROVED, application_round=current_round)
        self.client.force_login(applicant.applicant.account)

        response = self.client.get(reverse('eligibility-results'))
        self.assertNotContains(response, '<h1>Your Initial Application is Under Review</h1>', html=True)
        self.assertContains(response, '<h1>Initial application approved for Outreachy</h1>', html=True)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 10
0
    def test_initial_application_results_pending_after_contributions_open(self):
        """
        This tests that the initial application results.
        The applicant was not reviewed, either because they didn't answer our emails, or we didn't have time to review all applications.
        The round is in the contribution application period.
        /eligibility-results/ should show the person is rejected.
        """
        current_round = factories.RoundPageFactory(start_from='contributions_open')
        applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.PENDING, application_round=current_round)
        self.client.force_login(applicant.applicant.account)

        response = self.client.get(reverse('eligibility-results'))
        self.assertNotContains(response, '<h1>Your Initial Application is Under Review</h1>', html=True)
        self.assertContains(response, '<h1>Initial application is not approved</h1>', html=True)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 11
0
    def test_initial_application_results_time_rejection(self):
        """
        This tests that the initial application results.
        The applicant is rejected because of 'TIME' - they don't have 49 out of 91 days free from full-time commitments.
        The round is in the initial application period.
        /eligibility-results/ should not show the person is rejected.
        """
        current_round = factories.RoundPageFactory(start_from='initial_applications_open')
        applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.REJECTED, reason_denied='TIME', application_round=current_round)
        self.client.force_login(applicant.applicant.account)

        response = self.client.get(reverse('eligibility-results'))
        self.assertContains(response, '<h1>Your Initial Application is Under Review</h1>', html=True)
        self.assertNotContains(response, '<h1>Initial application is not approved</h1>', html=True)
        self.assertNotContains(response, '<p>After reviewing your time commitments, we have determined you do not meet our minimum free time criteria.</p>', html=True)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 12
0
    def test_initial_application_results_general_rejection(self):
        """
        This tests that the initial application results.
        The applicant is rejected because of 'GENERAL' - they don't meet our eligibility rules
        The round is in the initial application period.
        /eligibility-results/ should not show the person is rejected.
        """
        current_round = factories.RoundPageFactory(start_from='initial_applications_open')
        applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.REJECTED, reason_denied='GENERAL', application_round=current_round)
        self.client.force_login(applicant.applicant.account)

        response = self.client.get(reverse('eligibility-results'))
        self.assertContains(response, '<h1>Your Initial Application is Under Review</h1>', html=True)
        self.assertNotContains(response, '<h1>Initial application is not approved</h1>', html=True)
        self.assertNotContains(response, '<li>You may have already participated in Google Summer of Code or a previous Outreachy round.</li>', html=True)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 13
0
    def test_initial_application_results_alignment_rejection_after_contributions_open(self):
        """
        This tests that the initial application results.
        The applicant is rejected because of 'ALIGN' - mis-alignment with Outreachy program goals.
        The round is in the contribution application period.
        /eligibility-results/ should show the person is rejected.
        """
        current_round = factories.RoundPageFactory(start_from='contributions_open')
        applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.REJECTED, reason_denied='ALIGN', application_round=current_round)
        self.client.force_login(applicant.applicant.account)

        response = self.client.get(reverse('eligibility-results'))
        self.assertNotContains(response, '<h1>Your Initial Application is Under Review</h1>', html=True)
        self.assertContains(response, '<h1>Initial application is not approved</h1>', html=True)
        self.assertContains(response, '<p>The Outreachy organizers have been reviewing your initial application, including your essay questions.</p>', html=True)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 14
0
    def test_applicant_prompts_alignment_time_general_rejection_before_contributions_open(self):
        """
        This tests that the initial application results.
        The applicant is rejected because of 'ALIGN' - mis-alignment with Outreachy program goals.
        The round is in the initial application period.
        /dashboard/ should NOT show the person is rejected.
        """
        current_round = factories.RoundPageFactory(start_from='initial_applications_open')
        for rejection_reason in ['GENERAL', 'TIME', 'ALIGN', ]:
            with self.subTest(rejection_reason=rejection_reason):
                applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.REJECTED, reason_denied=rejection_reason, application_round=current_round)
                self.client.force_login(applicant.applicant.account)

                response = self.client.get(reverse('dashboard'))
                self.assertNotContains(response, '<div class="card-header text-white bg-warning">Initial Application Not Approved</div>', html=True)
                self.assertContains(response, '<div class="card-header text-white bg-warning">Outreachy Initial Application Under Review</div>', html=True)
                self.assertEqual(response.status_code, 200)
Exemplo n.º 15
0
    def test_project_list_approved_after_contributions_open(self):
        """
        This tests that the initial application results.
        The applicant is approved.
        The round is in the initial application period.
        They shouldn't be able to see links to community pages or project details.
        """
        project = self.setup_approved_project_approved_community('contributions_open')

        applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.APPROVED, application_round=project.project_round.participating_round)
        self.client.force_login(applicant.applicant.account)

        response = self.client.get(reverse('project-selection'))
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, '<h4 id="debian">Debian - 2 interns</h4>', html=True)
        self.assertNotContains(response, 'Project details are hidden.')
        self.assertContains(response, '<a href="{}">Debian community landing page</a>'.format(reverse('community-landing', kwargs={'round_slug': project.project_round.participating_round.slug, 'community_slug': project.project_round.community.slug})), html=True)
        self.assertContains(response, '<a href="{}#{}">{}</a>'.format(project.project_round.get_absolute_url(), project.slug, project.short_title), html=True)
Exemplo n.º 16
0
    def test_contribution_recording_general_time_align_rejection_after_contribution_opens(self):
        """
        This tests permissions based on initial application status and whether the round is in the initial application or contribution period.
        Subtests:
         - The applicant is rejected because of 'GENERAL' - they don't meet our eligibility rules
         - The applicant is rejected because of 'TIME' - they don't have 49 out of 91 days free from full-time commitments.
         - The applicant is rejected because of 'ALIGN' - mis-alignment with Outreachy program goals.
        The round is in the contribution period.
        They shouldn't be able to record a contribution.
        """
        project = self.setup_approved_project_approved_community('contributions_open')

        for rejection_reason in ['GENERAL', 'TIME', 'ALIGN', ]:
            with self.subTest(rejection_reason=rejection_reason):
                applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.REJECTED, reason_denied=rejection_reason, application_round=project.project_round.participating_round)
                self.client.force_login(applicant.applicant.account)

                response = self.client.get(reverse('contributions-add', kwargs={'round_slug': project.project_round.participating_round.slug, 'community_slug': project.project_round.community.slug, 'project_slug': project.slug }))
                # If an applicant is still under review we direct back to the eligibility results page
                self.assertRedirects(response, reverse('eligibility-results'))
Exemplo n.º 17
0
    def test_community_landing_pending_after_contribution_opens(self):
        """
        This tests that the initial application results.
        The applicant is pending because their application didn't get reviewed.
        The round is in the contribution period.
        They shouldn't be able to see projects on the community landing page.
        """
        project = self.setup_approved_project_approved_community('contributions_open')

        applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.PENDING, application_round=project.project_round.participating_round)
        self.client.force_login(applicant.applicant.account)

        response = self.client.get(reverse('community-landing', kwargs={'round_slug': project.project_round.participating_round.slug, 'community_slug': project.project_round.community.slug}))
        self.assertEqual(response.status_code, 200)
        self.assertContains(response,
                '<p>This information is only available to applicants who have their initial application approved. Check your <a href="{}">initial application results</a> for more details.</p>'.format(reverse('eligibility-results')),
                html=True)
        self.assertNotContains(response, '<h1>Outreachy Internships with Debian</h1>', html=True)
        self.assertNotContains(response, '<h1>Open Projects</h1>', html=True)
        self.assertNotContains(response, '<div class="card border" id="debian-{}">'.format(project.slug), html=True)
        self.assertNotContains(response, '<hr id="{}">'.format(project.slug), html=True)
        self.assertNotContains(response, '<h2>{}</h2>'.format(project.short_title), html=True)
Exemplo n.º 18
0
    def test_project_list_general_time_align_rejection_after_contribution_opens(self):
        """
        This tests that the initial application results.
        Subtests:
         - The applicant is rejected because of 'GENERAL' - they don't meet our eligibility rules
         - The applicant is rejected because of 'TIME' - they don't have 49 out of 91 days free from full-time commitments.
         - The applicant is rejected because of 'ALIGN' - mis-alignment with Outreachy program goals.
        The round is in the initial application period.
        They shouldn't be able to see links to community pages or project details.
        """
        project = self.setup_approved_project_approved_community('contributions_open')

        for rejection_reason in ['GENERAL', 'TIME', 'ALIGN', ]:
            with self.subTest(rejection_reason=rejection_reason):
                applicant = factories.ApplicantApprovalFactory(approval_status=models.ApprovalStatus.REJECTED, reason_denied=rejection_reason, application_round=project.project_round.participating_round)
                self.client.force_login(applicant.applicant.account)

                response = self.client.get(reverse('project-selection'))
                self.assertEqual(response.status_code, 200)
                self.assertContains(response, '<h4 id="debian">Debian - 2 interns</h4>', html=True)
                self.assertContains(response, 'Project details are hidden.')
                self.assertNotContains(response, '<a href="{}">Debian community landing page</a>'.format(reverse('community-landing', kwargs={'round_slug': project.project_round.participating_round.slug, 'community_slug': project.project_round.community.slug})), html=True)
                self.assertNotContains(response, '<a href="{}#{}">{}</a>'.format(project.project_round.get_absolute_url(), project.slug, project.short_title), html=True)