new workspace members are provisional until they log in for the first time

This commit is contained in:
dandds
2018-10-25 11:25:58 -04:00
parent 8f146b2fee
commit 49f5edfe29
7 changed files with 76 additions and 1 deletions

View File

@@ -211,3 +211,17 @@ def test_redirected_on_login(client, monkeypatch):
target_route = url_for("requests.requests_form_new", screen=1)
response = _login(client, next=target_route)
assert target_route in response.headers.get("Location")
def test_invited_user_finalized_on_login(monkeypatch, client):
user = UserFactory.create(provisional=True)
monkeypatch.setattr(
"atst.domain.authnid.AuthenticationContext.authenticate", lambda *args: True
)
monkeypatch.setattr(
"atst.domain.authnid.AuthenticationContext.get_user", lambda *args: user
)
resp = _login(client)
assert not user.provisional