Keep test coverage, but skip front end tests for requests
This commit is contained in:
@@ -21,7 +21,6 @@ def new_request(session):
|
||||
return RequestFactory.create()
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_can_get_request():
|
||||
factory_req = RequestFactory.create()
|
||||
request = Requests.get(factory_req.creator, factory_req.id)
|
||||
@@ -29,20 +28,17 @@ def test_can_get_request():
|
||||
assert request.id == factory_req.id
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_nonexistent_request_raises():
|
||||
a_user = UserFactory.build()
|
||||
with pytest.raises(NotFoundError):
|
||||
Requests.get(a_user, uuid4())
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_new_request_has_started_status():
|
||||
request = Requests.create(UserFactory.build(), {})
|
||||
assert request.status == RequestStatus.STARTED
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_auto_approve_less_than_1m():
|
||||
new_request = RequestFactory.create(initial_revision={"dollar_value": 999_999})
|
||||
request = Requests.submit(new_request)
|
||||
@@ -52,7 +48,6 @@ def test_auto_approve_less_than_1m():
|
||||
assert request.reviews[0].full_name_reviewer == "System"
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_dont_auto_approve_if_dollar_value_is_1m_or_above():
|
||||
new_request = RequestFactory.create(initial_revision={"dollar_value": 1_000_000})
|
||||
request = Requests.submit(new_request)
|
||||
@@ -60,7 +55,6 @@ def test_dont_auto_approve_if_dollar_value_is_1m_or_above():
|
||||
assert request.status == RequestStatus.PENDING_CCPO_ACCEPTANCE
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_dont_auto_approve_if_no_dollar_value_specified():
|
||||
new_request = RequestFactory.create(initial_revision={})
|
||||
request = Requests.submit(new_request)
|
||||
@@ -68,7 +62,6 @@ def test_dont_auto_approve_if_no_dollar_value_specified():
|
||||
assert request.status == RequestStatus.PENDING_CCPO_ACCEPTANCE
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_should_allow_submission():
|
||||
new_request = RequestFactory.create()
|
||||
|
||||
@@ -86,18 +79,15 @@ def test_should_allow_submission():
|
||||
assert not Requests.should_allow_submission(new_request)
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_request_knows_its_last_submission_timestamp(new_request):
|
||||
submitted_request = Requests.submit(new_request)
|
||||
assert submitted_request.last_submission_timestamp
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_request_knows_if_it_has_no_last_submission_timestamp(new_request):
|
||||
assert new_request.last_submission_timestamp is None
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_exists(session):
|
||||
user_allowed = UserFactory.create()
|
||||
user_denied = UserFactory.create()
|
||||
@@ -106,7 +96,6 @@ def test_exists(session):
|
||||
assert not Requests.exists(request.id, user_denied)
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_status_count(session):
|
||||
# make sure table is empty
|
||||
session.query(Request).delete()
|
||||
@@ -125,7 +114,6 @@ def test_status_count(session):
|
||||
assert Requests.in_progress_count() == 2
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_status_count_scoped_to_creator(session):
|
||||
# make sure table is empty
|
||||
session.query(Request).delete()
|
||||
@@ -155,14 +143,12 @@ request_financial_data = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_set_status_sets_revision():
|
||||
request = RequestFactory.create()
|
||||
Requests.set_status(request, RequestStatus.APPROVED)
|
||||
assert request.latest_revision == request.status_events[-1].revision
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_advance_to_financial_verification():
|
||||
request = RequestFactory.create_with_status(
|
||||
status=RequestStatus.PENDING_CCPO_ACCEPTANCE
|
||||
@@ -174,7 +160,6 @@ def test_advance_to_financial_verification():
|
||||
assert current_review.fname_mao == review_data["fname_mao"]
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_advance_to_approval():
|
||||
request = RequestFactory.create_with_status(
|
||||
status=RequestStatus.PENDING_CCPO_APPROVAL
|
||||
@@ -184,7 +169,6 @@ def test_advance_to_approval():
|
||||
assert request.status == RequestStatus.APPROVED
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_request_changes_to_request_application():
|
||||
request = RequestFactory.create_with_status(
|
||||
status=RequestStatus.PENDING_CCPO_ACCEPTANCE
|
||||
@@ -196,7 +180,6 @@ def test_request_changes_to_request_application():
|
||||
assert current_review.fname_mao == review_data["fname_mao"]
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_request_changes_to_financial_verification_info():
|
||||
request = RequestFactory.create_with_status(
|
||||
status=RequestStatus.PENDING_CCPO_APPROVAL
|
||||
@@ -208,7 +191,6 @@ def test_request_changes_to_financial_verification_info():
|
||||
assert current_review.fname_mao == review_data["fname_mao"]
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_add_internal_comment():
|
||||
request = RequestFactory.create()
|
||||
ccpo = UserFactory.from_atat_role("ccpo")
|
||||
@@ -221,7 +203,6 @@ def test_add_internal_comment():
|
||||
assert request.internal_comments[0].text == "this is my comment"
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_creator_can_view_own_request():
|
||||
creator = UserFactory.create()
|
||||
request = RequestFactory.create(creator=creator)
|
||||
@@ -229,7 +210,6 @@ def test_creator_can_view_own_request():
|
||||
assert RequestsAuthorization(creator, request).can_view
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_ccpo_can_view_request():
|
||||
ccpo = UserFactory.from_atat_role("ccpo")
|
||||
request = RequestFactory.create()
|
||||
@@ -237,7 +217,6 @@ def test_ccpo_can_view_request():
|
||||
assert RequestsAuthorization(ccpo, request).can_view
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_random_user_cannot_view_request():
|
||||
user = UserFactory.create()
|
||||
request = RequestFactory.create()
|
||||
@@ -245,7 +224,6 @@ def test_random_user_cannot_view_request():
|
||||
assert not RequestsAuthorization(user, request).can_view
|
||||
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_auto_approve_and_create_workspace():
|
||||
request = RequestFactory.create()
|
||||
workspace = Requests.auto_approve_and_create_workspace(request)
|
||||
@@ -261,7 +239,6 @@ class TestStatusNotifications(object):
|
||||
assert job.func == queue._send_mail
|
||||
assert job.args[0] == [request.creator.email]
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_pending_finver_triggers_notification(self, queue):
|
||||
request = RequestFactory.create()
|
||||
request = Requests.set_status(request, RequestStatus.PENDING_CCPO_ACCEPTANCE)
|
||||
@@ -270,14 +247,12 @@ class TestStatusNotifications(object):
|
||||
)
|
||||
self._assert_job(queue, request)
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_changes_requested_triggers_notification(self, queue):
|
||||
request = RequestFactory.create()
|
||||
request = Requests.set_status(request, RequestStatus.PENDING_CCPO_ACCEPTANCE)
|
||||
request = Requests.set_status(request, RequestStatus.CHANGES_REQUESTED)
|
||||
self._assert_job(queue, request)
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_changes_requested_to_finver_triggers_notification(self, queue):
|
||||
request = RequestFactory.create()
|
||||
request = Requests.set_status(request, RequestStatus.PENDING_CCPO_APPROVAL)
|
||||
@@ -286,14 +261,12 @@ class TestStatusNotifications(object):
|
||||
)
|
||||
self._assert_job(queue, request)
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_approval_triggers_notification(self, queue):
|
||||
request = RequestFactory.create()
|
||||
request = Requests.set_status(request, RequestStatus.PENDING_CCPO_APPROVAL)
|
||||
request = Requests.set_status(request, RequestStatus.APPROVED)
|
||||
self._assert_job(queue, request)
|
||||
|
||||
@pytest.mark.requests_workflow
|
||||
def test_submitted_does_not_trigger_notification(self, queue):
|
||||
request = RequestFactory.create()
|
||||
request = Requests.set_status(request, RequestStatus.SUBMITTED)
|
||||
|
Reference in New Issue
Block a user