Beispiel #1
0
    def test_one_card_in_progress_before_any_reviews(self):

        # One card, no reviews just yet, function 'get_cards_in_progress_column_as_assignee' should return one card
        self.assertEqual(self.card_1.status, AgileCard.IN_PROGRESS)
        self.assertEqual(self.project_1.content_item, self.card_1.content_item)
        self.assertEqual(AgileCard.derive_status_from_project(self.project_1),
                         AgileCard.IN_PROGRESS)
        self.assertEqual(
            self.stats_serializer.get_cards_in_progress_column_as_assignee(
                user=self.user), 1)
Beispiel #2
0
    def test_untrusted_nyc_after_request_for_review(self):
        self.project.request_review(force_timestamp=datetime.now() -
                                    timedelta(days=10))
        review = factories.RecruitProjectReviewFactory(
            status=NOT_YET_COMPETENT, recruit_project=self.project)
        self.assertFalse(review.trusted)

        self.assertEqual(
            AgileCard.derive_status_from_project(self.project),
            AgileCard.REVIEW_FEEDBACK,
        )
Beispiel #3
0
    def test_untrusted_competent_after_request_for_review(self):
        review = factories.RecruitProjectReviewFactory(
            status=COMPETENT, recruit_project=self.project)
        self.project.request_review(force_timestamp=datetime.now() -
                                    timedelta(days=10))

        self.assertFalse(review.trusted)

        # breakpoint()
        derived = AgileCard.derive_status_from_project(self.project)
        self.assertEqual(derived, AgileCard.IN_REVIEW)
Beispiel #4
0
    def test_trusted_competent_after_request_for_review(self):
        review = factories.RecruitProjectReviewFactory(
            status=COMPETENT,
            recruit_project=self.project,
            reviewer_user=self.trusted_user,
        )
        self.project.request_review(force_timestamp=datetime.now() -
                                    timedelta(days=10))

        self.assertTrue(review.trusted)

        self.assertEqual(AgileCard.derive_status_from_project(self.project),
                         AgileCard.COMPLETE)
Beispiel #5
0
    def test_trusted_nyc_before_request_for_review(self):
        review = factories.RecruitProjectReviewFactory(
            status=NOT_YET_COMPETENT,
            recruit_project=self.project,
            reviewer_user=self.trusted_user,
        )
        self.assertTrue(review.trusted)

        self.project.request_review(force_timestamp=datetime.now() +
                                    timedelta(days=10))

        self.assertEqual(AgileCard.derive_status_from_project(self.project),
                         AgileCard.IN_REVIEW)
Beispiel #6
0
    def test_untrusted_nyc_before_request_for_review(self):
        self.set_project_start_time()
        self.project.request_review(force_timestamp=timezone.now() +
                                    timedelta(days=10))
        review = factories.RecruitProjectReviewFactory(
            status=NOT_YET_COMPETENT,
            recruit_project=self.project,
        )

        self.assertFalse(review.trusted)

        self.assertEqual(AgileCard.derive_status_from_project(self.project),
                         AgileCard.IN_REVIEW)
Beispiel #7
0
    def test_trusted_nyc_after_request_for_review(self):
        self.set_project_start_time()
        self.project.request_review(force_timestamp=timezone.now() - timedelta(days=10))
        review = factories.RecruitProjectReviewFactory(
            status=NOT_YET_COMPETENT,
            recruit_project=self.project,
            reviewer_user=self.trusted_user,
        )

        self.assertTrue(review.trusted)

        self.assertEqual(
            AgileCard.derive_status_from_project(self.project),
            AgileCard.REVIEW_FEEDBACK,
        )
Beispiel #8
0
 def test_no_reviews_or_review_request(self):
     self.assertEqual(AgileCard.derive_status_from_project(self.project),
                      AgileCard.IN_PROGRESS)