Beispiel #1
0
def test_token_updater_with_user(token, rf):
    user = EditorFactory()
    rf.user = user
    api._token_updater(token, rf)(token)
    assert token["access_token"] == "eswfld123kjhn1v5423"
    assert isinstance(token["expires_at"], int)
    assert user.access_token == "eswfld123kjhn1v5423"
    assert isinstance(user.token_expiration, int)
Beispiel #2
0
def test_token_updater_with_no_user(token, rf):
    api._token_updater(token, rf)(token)
    assert token["access_token"] == "eswfld123kjhn1v5423"
    assert isinstance(token["expires_at"], int)