Requests pending CCPO apprval should not be given workspaces

This commit is contained in:
richard-dds 2018-10-24 12:17:43 -04:00
parent 8a291124b0
commit a31d285f17
2 changed files with 20 additions and 9 deletions

View File

@ -241,7 +241,7 @@ def update_financial_verification(request_id):
extended=is_extended, extended=is_extended,
) )
if updated_request.is_pending_ccpo_approval: if updated_request.is_approved:
workspace = Requests.approve_and_create_workspace(updated_request) workspace = Requests.approve_and_create_workspace(updated_request)
return redirect( return redirect(
url_for( url_for(

View File

@ -10,20 +10,16 @@ from atst.routes.requests.financial_verification import (
SaveFinancialVerificationDraft, SaveFinancialVerificationDraft,
) )
from tests.mocks import MOCK_REQUEST, MOCK_USER, MOCK_VALID_PE_ID from tests.mocks import MOCK_VALID_PE_ID
from tests.factories import ( from tests.factories import RequestFactory, UserFactory
PENumberFactory,
RequestFactory,
UserFactory,
RequestStatusEventFactory,
RequestReviewFactory,
)
from atst.forms.exceptions import FormValidationError from atst.forms.exceptions import FormValidationError
from atst.domain.requests.financial_verification import ( from atst.domain.requests.financial_verification import (
PENumberValidator, PENumberValidator,
TaskOrderNumberValidator, TaskOrderNumberValidator,
) )
from atst.utils import pick from atst.utils import pick
from atst.models.request_status_event import RequestStatus
from atst.domain.requests.query import RequestsQuery
@pytest.fixture @pytest.fixture
@ -347,3 +343,18 @@ def test_manual_task_order_triggers_extended_form(
follow_redirects=False, follow_redirects=False,
) )
assert "extended" in response.headers["Location"] assert "extended" in response.headers["Location"]
def test_manual_to_does_not_trigger_approval(client, user_session, fv_data, e_fv_data):
user = UserFactory.create()
request = RequestFactory.create(creator=user)
data = {**fv_data, **e_fv_data, "request-pe_id": "0101228N"}
user_session(user)
client.post(
url_for("requests.financial_verification", request_id=request.id, extended=True),
data=data,
follow_redirects=True
)
updated_request = RequestsQuery.get(request.id)
assert updated_request.status != RequestStatus.APPROVED