Skip to content

Commit

Permalink
Update python tests for signup
Browse files Browse the repository at this point in the history
  • Loading branch information
zlwaterfield committed Mar 25, 2024
1 parent e52d970 commit 7ed76e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions posthog/api/test/test_signup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def test_api_sign_up(self, mock_capture):
"/api/signup/",
{
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"password": "notsecure",
"organization_name": "Hedgehogs United, LLC",
Expand All @@ -62,8 +63,8 @@ def test_api_sign_up(self, mock_capture):
"id": user.pk,
"uuid": str(user.uuid),
"distinct_id": user.distinct_id,
"last_name": "",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"redirect_url": "/",
"is_email_verified": False,
Expand All @@ -72,6 +73,7 @@ def test_api_sign_up(self, mock_capture):

# Assert that the user was properly created
self.assertEqual(user.first_name, "John")
self.assertEqual(user.last_name, "Doe")
self.assertEqual(user.email, "[email protected]")
self.assertFalse(user.email_opt_in)
self.assertTrue(user.is_staff) # True because this is the first user in the instance
Expand Down Expand Up @@ -223,7 +225,7 @@ def test_signup_minimum_attrs(self, mock_capture):
self.assertEqual(user.first_name, "Jane")
self.assertEqual(user.email, "[email protected]")
self.assertTrue(user.email_opt_in) # Defaults to True
self.assertEqual(organization.name, "Jane")
self.assertEqual(organization.name, f"{user.first_name}'s Organization")
self.assertTrue(user.is_staff) # True because this is the first user in the instance

# Assert that the sign up event & identify calls were sent to PostHog analytics
Expand Down

0 comments on commit 7ed76e0

Please sign in to comment.