diff --git a/tests/models/test_requests.py b/tests/models/test_requests.py
index 7f5a3650..528d0b06 100644
--- a/tests/models/test_requests.py
+++ b/tests/models/test_requests.py
@@ -92,3 +92,26 @@ def test_reviews():
RequestStatusEventFactory.create(revision=request.latest_revision),
]
assert len(request.reviews) == 2
+
+
+def test_review_comment():
+ request = RequestFactory.create()
+ ccpo = UserFactory.from_atat_role("ccpo")
+ request.status_events = [
+ RequestStatusEventFactory.create(
+ revision=request.latest_revision,
+ new_status=RequestStatus.CHANGES_REQUESTED,
+ review=RequestReviewFactory.create(reviewer=ccpo, comment="do better"),
+ )
+ ]
+ assert request.review_comment == "do better"
+
+ request.status_events = [
+ RequestStatusEventFactory.create(
+ revision=request.latest_revision,
+ new_status=RequestStatus.APPROVED,
+ review=RequestReviewFactory.create(reviewer=ccpo, comment="much better"),
+ )
+ ]
+
+ assert not request.review_comment
diff --git a/tests/routes/test_financial_verification.py b/tests/routes/test_financial_verification.py
index 71c38f00..1a2c4606 100644
--- a/tests/routes/test_financial_verification.py
+++ b/tests/routes/test_financial_verification.py
@@ -3,9 +3,16 @@ import pytest
from flask import url_for
from atst.eda_client import MockEDAClient
+from atst.models.request_status_event import RequestStatus
from tests.mocks import MOCK_REQUEST, MOCK_USER
-from tests.factories import PENumberFactory, RequestFactory, UserFactory
+from tests.factories import (
+ PENumberFactory,
+ RequestFactory,
+ UserFactory,
+ RequestStatusEventFactory,
+ RequestReviewFactory,
+)
class TestPENumberInForm:
@@ -148,3 +155,21 @@ class TestPENumberInForm:
response = self.submit_data(client, user, data, extended=True)
assert response.status_code == 200
+
+
+def test_displays_ccpo_review_comment(user_session, client):
+ creator = UserFactory.create()
+ ccpo = UserFactory.from_atat_role("ccpo")
+ user_session(creator)
+ request = RequestFactory.create(creator=creator)
+ review_comment = "add all of the correct info, instead of the incorrect info"
+ request.status_events = [
+ RequestStatusEventFactory.create(
+ revision=request.latest_revision,
+ new_status=RequestStatus.CHANGES_REQUESTED_TO_FINVER,
+ review=RequestReviewFactory.create(reviewer=ccpo, comment=review_comment),
+ )
+ ]
+ response = client.get("/requests/verify/{}".format(request.id))
+ body = response.data.decode()
+ assert review_comment in body
diff --git a/tests/routes/test_request_new.py b/tests/routes/test_request_new.py
index b27f4758..9bc8a668 100644
--- a/tests/routes/test_request_new.py
+++ b/tests/routes/test_request_new.py
@@ -1,5 +1,12 @@
import re
-from tests.factories import RequestFactory, UserFactory, RequestRevisionFactory
+from tests.factories import (
+ RequestFactory,
+ UserFactory,
+ RequestRevisionFactory,
+ RequestStatusEventFactory,
+ RequestReviewFactory,
+)
+from atst.models.request_status_event import RequestStatus
from atst.domain.roles import Roles
from atst.domain.requests import Requests
from urllib.parse import urlencode
@@ -213,3 +220,21 @@ def test_can_review_data(user_session, client):
# assert a sampling of the request data is on the review page
assert request.body["primary_poc"]["fname_poc"] in body
assert request.body["information_about_you"]["email_request"] in body
+
+
+def test_displays_ccpo_review_comment(user_session, client):
+ creator = UserFactory.create()
+ ccpo = UserFactory.from_atat_role("ccpo")
+ user_session(creator)
+ request = RequestFactory.create(creator=creator)
+ review_comment = "add all of the correct info, instead of the incorrect info"
+ request.status_events = [
+ RequestStatusEventFactory.create(
+ revision=request.latest_revision,
+ new_status=RequestStatus.CHANGES_REQUESTED,
+ review=RequestReviewFactory.create(reviewer=ccpo, comment=review_comment),
+ )
+ ]
+ response = client.get("/requests/new/1/{}".format(request.id))
+ body = response.data.decode()
+ assert review_comment in body