Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
suejung-sentry committed Jan 9, 2025
1 parent ec18bbd commit 1e5a0e4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions graphql_api/tests/test_owner.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,26 @@ def test_fetch_owner_on_unauthenticated_enteprise_guest_access_not_activated(sel
assert e.message == UnauthorizedGuestAccess.message
assert e.extensions["code"] == UnauthorizedGuestAccess.code

@override_settings(IS_ENTERPRISE=True, GUEST_ACCESS=False)
def test_fetch_owner_plan_activated_users_is_none(self):
"""
This test is when Enterprise guest access is disabled, and you are
trying to view an org that does not track plan activated users (e.g., historic data)
"""
user = OwnerFactory(username="sample-user")
owner = OwnerFactory(username="sample-owner", plan_activated_users=None)
user.save()
owner.save()
query = """{
owner(username: "%s") {
username
}
}
""" % (owner.username)

data = self.gql_request(query, owner=user)
assert data["owner"]["username"] == "sample-owner"

def test_fetch_current_user_is_okta_authenticated(self):
account = AccountFactory()
owner = OwnerFactory(username="sample-owner", service="github", account=account)
Expand Down

0 comments on commit 1e5a0e4

Please sign in to comment.