ccpo should see request approval screen for all request
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from flask import url_for
|
||||
|
||||
from atst.routes.requests.index import RequestsIndex
|
||||
from tests.factories import RequestFactory, UserFactory
|
||||
from atst.domain.requests import Requests
|
||||
@@ -21,3 +23,20 @@ def test_action_required_ccpo():
|
||||
context = RequestsIndex(ccpo).execute()
|
||||
|
||||
assert context["num_action_required"] == 1
|
||||
|
||||
|
||||
def test_ccpo_sees_approval_screen():
|
||||
ccpo = UserFactory.from_atat_role("ccpo")
|
||||
request = RequestFactory.create()
|
||||
Requests.submit(request)
|
||||
ccpo_context = RequestsIndex(ccpo).execute()
|
||||
assert (
|
||||
ccpo_context["requests"][0]["edit_link"]
|
||||
== url_for("requests.approval", request_id=request.id)
|
||||
)
|
||||
|
||||
mo_context = RequestsIndex(request.creator).execute()
|
||||
assert (
|
||||
mo_context["requests"][0]["edit_link"]
|
||||
!= url_for("requests.approval", request_id=request.id)
|
||||
)
|
||||
|
Reference in New Issue
Block a user