provide dev access to app

This commit is contained in:
dandds
2018-06-11 16:24:08 -04:00
parent 25db6fabbe
commit d573c5459b
4 changed files with 47 additions and 16 deletions

View File

@@ -11,7 +11,6 @@ def test_redirects_when_not_logged_in(http_client, base_url):
assert response.error
assert response.headers["Location"] == "/login"
@pytest.mark.gen_test
def test_login_with_valid_bearer_token(app, monkeypatch, http_client, base_url):
monkeypatch.setattr("atst.handler.validate_login_token", lambda t: True)
@@ -22,6 +21,14 @@ def test_login_with_valid_bearer_token(app, monkeypatch, http_client, base_url):
assert response.code == 200
assert not response.error
@pytest.mark.gen_test
def test_login_with_via_dev_endpoint(app, monkeypatch, http_client, base_url):
response = yield http_client.fetch(
base_url + "/login-dev", raise_error=False, follow_redirects=False
)
assert response.headers['Set-Cookie'].startswith('atst')
assert response.code == 302
assert response.headers["Location"] == "/home"
@pytest.mark.gen_test
@pytest.mark.skip(reason="need to work out auth error user paths")