apply auth requirement to virtually all endpoints

This commit is contained in:
dandds
2018-08-06 10:43:44 -04:00
committed by richard-dds
parent ed1e8bffd1
commit 2d5651a21d
11 changed files with 59 additions and 11 deletions

View File

@@ -7,7 +7,8 @@ def _mock_func(*args, **kwargs):
return RequestFactory.create()
def test_submit_reviewed_request(monkeypatch, client):
def test_submit_reviewed_request(monkeypatch, client, user_session):
user_session()
monkeypatch.setattr("atst.domain.requests.Requests.get", _mock_func)
monkeypatch.setattr("atst.domain.requests.Requests.submit", _mock_func)
monkeypatch.setattr("atst.models.request.Request.status", "pending")
@@ -22,7 +23,8 @@ def test_submit_reviewed_request(monkeypatch, client):
assert "modal" not in response.headers["Location"]
def test_submit_autoapproved_reviewed_request(monkeypatch, client):
def test_submit_autoapproved_reviewed_request(monkeypatch, client, user_session):
user_session()
monkeypatch.setattr("atst.domain.requests.Requests.get", _mock_func)
monkeypatch.setattr("atst.domain.requests.Requests.submit", _mock_func)
monkeypatch.setattr("atst.models.request.Request.status", "approved")