display review comment for request that needs changes

This commit is contained in:
dandds 2018-09-14 11:03:53 -04:00
parent 73d3851813
commit 7f9c7dcaec
3 changed files with 35 additions and 1 deletions

View File

@ -62,6 +62,7 @@ def requests_form_update(screen=1, request_id=None):
next_screen=screen + 1,
request_id=request_id,
jedi_request=jedi_flow.request,
review_comment=request.review_comment,
can_submit=jedi_flow.can_submit,
)

View File

@ -1,11 +1,19 @@
{% extends "base.html" %}
{% from "components/alert.html" import Alert %}
{% block content %}
<div class="col">
{% include 'requests/menu.html' %}
{% if review_comment %}
{{ 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') }}
{% endif %}
{% block form_action %}
{% if request_id %}
<form method='POST' action="{{ url_for('requests.requests_form_update', screen=current, request_id=request_id) }}" autocomplete="off">

View File

@ -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