@@ -762,6 +762,30 @@ def test_fetch_owner_on_unauthenticated_enteprise_guest_access(self):
762762 assert e .message == UnauthorizedGuestAccess .message
763763 assert e .extensions ["code" ] == UnauthorizedGuestAccess .code
764764
765+ @override_settings (IS_ENTERPRISE = True , GUEST_ACCESS = False )
766+ def test_fetch_owner_on_unauthenticated_enteprise_guest_access_not_activated (self ):
767+ user = OwnerFactory (username = "sample-user" )
768+ owner = OwnerFactory (username = "sample-owner" , plan_activated_users = [123 , 456 ])
769+ user .organizations = [owner .ownerid ]
770+ user .save ()
771+ owner .save ()
772+ query = (
773+ """{
774+ owner(username: "%s") {
775+ isCurrentUserActivated
776+ }
777+ }
778+ """
779+ % owner .username
780+ )
781+
782+ try :
783+ self .gql_request (query , owner = user )
784+
785+ except GraphQLError as e :
786+ assert e .message == UnauthorizedGuestAccess .message
787+ assert e .extensions ["code" ] == UnauthorizedGuestAccess .code
788+
765789 def test_fetch_current_user_is_okta_authenticated (self ):
766790 account = AccountFactory ()
767791 owner = OwnerFactory (username = "sample-owner" , service = "github" , account = account )
@@ -820,7 +844,7 @@ def test_fetch_current_user_is_not_okta_authenticated_no_account(self):
820844
821845 @patch ("shared.rate_limits.determine_entity_redis_key" )
822846 @patch ("shared.rate_limits.determine_if_entity_is_rate_limited" )
823- @override_settings (IS_ENTERPRISE = True , GUEST_ACCESS = False )
847+ @override_settings (IS_ENTERPRISE = True , GUEST_ACCESS = True )
824848 def test_fetch_is_github_rate_limited (
825849 self , mock_determine_rate_limit , mock_determine_redis_key
826850 ):
0 commit comments