display review comment for financial verification that needs changes

This commit is contained in:
dandds 2018-09-14 11:33:02 -04:00
parent 7f9c7dcaec
commit 8359a2a079
5 changed files with 37 additions and 6 deletions

View File

@ -39,6 +39,7 @@ def financial_verification(request_id=None):
"requests/financial_verification.html", "requests/financial_verification.html",
f=form, f=form,
request=request, request=request,
review_comment=request.review_comment,
extended=is_extended(request), extended=is_extended(request),
) )

View File

@ -1,7 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% from "components/alert.html" import Alert %}
{% block content %} {% block content %}
<div class="col"> <div class="col">
@ -9,9 +7,7 @@
{% include 'requests/menu.html' %} {% include 'requests/menu.html' %}
{% if review_comment %} {% if review_comment %}
{{ Alert('Changes Requested', {% include 'requests/comment.html' %}
message="<p>CCPO has requested changes to your submission with the following notes:<br>" + review_comment + "<br>Please contact info@jedi.cloud or 123-123-4567 for further discussion.</p>",
level='warning') }}
{% endif %} {% endif %}
{% block form_action %} {% block form_action %}

View File

@ -0,0 +1,5 @@
{% from "components/alert.html" import Alert %}
{{ Alert('Changes Requested',
message="<p>CCPO has requested changes to your submission with the following notes:<br>" + review_comment + "<br>Please contact info@jedi.cloud or 123-123-4567 for further discussion.</p>",
level='warning') }}

View File

@ -12,6 +12,10 @@
{{ Alert('Pending Financial Verification', fragment="fragments/pending_financial_verification.html") }} {{ Alert('Pending Financial Verification', fragment="fragments/pending_financial_verification.html") }}
{% endif %} {% endif %}
{% if review_comment %}
{% include 'requests/comment.html' %}
{% endif %}
<financial inline-template v-bind:initial-data='{{ f.data|mixedContentToJson }}'> <financial inline-template v-bind:initial-data='{{ f.data|mixedContentToJson }}'>
<div class="col"> <div class="col">

View File

@ -3,9 +3,16 @@ import pytest
from flask import url_for from flask import url_for
from atst.eda_client import MockEDAClient from atst.eda_client import MockEDAClient
from atst.models.request_status_event import RequestStatus
from tests.mocks import MOCK_REQUEST, MOCK_USER 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: class TestPENumberInForm:
@ -148,3 +155,21 @@ class TestPENumberInForm:
response = self.submit_data(client, user, data, extended=True) response = self.submit_data(client, user, data, extended=True)
assert response.status_code == 200 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