Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add update_user method #20

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add update_user test
stevenclouston committed Oct 3, 2024
commit d1577e1989c17192364ef788c83a74f6d6514c34
13 changes: 13 additions & 0 deletions authsignal/client_tests.py
Original file line number Diff line number Diff line change
@@ -86,6 +86,19 @@ def test_get_action(self):
self.assertEqual(response["state"], "ALLOW")
self.assertEqual(response["state_updated_at"], "2022-07-25T03:19:00.316Z")

@responses.activate
def test_update_user(self):
user_id = "1234"
data = {"email": "newemail@gmail.com"}
expected_response = {"email": "newemail@gmail.com"}

responses.add(responses.POST, f"{base_url}/users/{user_id}",
json=expected_response, status=200)

response = self.authsignal_client.update_user(user_id=user_id, data=data)

self.assertEqual(response["email"], "newemail@gmail.com")

class ValidateChallenge(unittest.TestCase):
def setUp(self):
self.api_key='SECRET'