def test_nipsa_calls_nipsa_api_with_userid(nipsa_api): request = testing.DummyRequest(params={"add": "kiki"}) nipsa.add_nipsa(request) nipsa_api.add_nipsa.assert_called_once_with( request, "acct:[email protected]")
def nipsa_add(request): username = request.params["add"] # It's important that we nipsa the full user ID # ("acct:[email protected]" not just "seanh"). userid = util.user.userid_from_username(username, request) nipsa.add_nipsa(request, userid) return nipsa_index(request)
def test_nipsa_returns_index(nipsa_api, index): request = testing.DummyRequest(params={"add": "kiki"}) index.return_value = "Keine Bange!" assert nipsa.add_nipsa(request) == "Keine Bange!"