def test_invite_users(self): """invite_users() makes a PUT request to /invite_users<id>""" uaac = UAAClient('http://example.com', 'foo', False) m = Mock() uaac._request = m email = '*****@*****.**' redirect_uri = 'http://www.example.com' uaac.invite_users(email, redirect_uri) m.assert_called_with( '/invite_users', 'POST', body={'emails': [email]}, params={'redirect_uri': redirect_uri} )
def test_users_with_token(self): """invite_users() makes a PUT request to /invite_users<id>""" uaac = UAAClient('http://example.com', 'foo', False) m = Mock() uaac._request = m email = '*****@*****.**' redirect_uri = 'http://www.example.com' uaac.invite_users(email, redirect_uri, token="foobar") m.assert_called_with( '/invite_users', 'POST', body={'emails': [email]}, headers={'Authorization': 'Bearer foobar'}, params={'redirect_uri': redirect_uri} )
def test_users_with_token(self): """invite_users() makes a PUT request to /invite_users<id>""" uaac = UAAClient("http://example.com", "foo", False) m = Mock() uaac._request = m email = "*****@*****.**" redirect_uri = "http://www.example.com" uaac.invite_users(email, redirect_uri, token="foobar") m.assert_called_with( "/invite_users", "POST", body={"emails": [email]}, headers={"Authorization": "Bearer foobar"}, params={"redirect_uri": redirect_uri}, )