Skip to content

Commit

Permalink
remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
zlwaterfield committed Oct 28, 2024
1 parent 1c48106 commit ef28610
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions posthog/api/test/test_signup.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,37 +695,6 @@ def run_test_for_allowed_domain(
# Check that the user was still created and added to the organization
self.assertEqual(user.organization, new_org)

def test_api_signup_with_sso_enforced_fails(self):
"""Test that users cannot sign up directly when SSO is enforced."""

# Create an organization with SSO enforcement
organization = Organization.objects.create(name="Test Org")
invite: OrganizationInvite = OrganizationInvite.objects.create(
target_email="[email protected]", organization=organization
)

response = self.client.post(
f"/api/signup/{invite.id}/",
{
"first_name": "Alice",
"password": VALID_TEST_PASSWORD,
},
)

self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(
response.json(),
{
"type": "validation_error",
"code": "sso_enforced",
"detail": "You cannot sign up by email when SSO is enforced.",
"attr": None,
},
)

# Verify no user was created
self.assertFalse(User.objects.filter(email="[email protected]").exists())

@patch("posthoganalytics.capture")
@mock.patch("social_core.backends.base.BaseAuth.request")
@mock.patch("posthog.api.authentication.get_instance_available_sso_providers")
Expand Down

0 comments on commit ef28610

Please sign in to comment.