(self)
| 785 | assert result.has_global_access |
| 786 | |
| 787 | def test_with_invalid_auth(self) -> None: |
| 788 | self.create_user() |
| 789 | organization = self.create_organization() |
| 790 | other_organization = self.create_organization() |
| 791 | |
| 792 | team = self.create_team(organization=organization) |
| 793 | project = self.create_project(organization=organization, teams=[team]) |
| 794 | |
| 795 | request = self.make_request() |
| 796 | # Using an API key for another org should be invalid |
| 797 | request.auth = self.create_api_key(organization=other_organization, allowed_origins="*") |
| 798 | result = self.from_request(request, organization) |
| 799 | |
| 800 | assert result == NoAccess() |
| 801 | |
| 802 | assert result.team_ids_with_membership == frozenset({}) |
| 803 | assert result.has_team_access(team) is False |
| 804 | assert result.project_ids_with_team_membership == frozenset({}) |
| 805 | assert result.has_project_access(project) is False |
| 806 | assert result.has_project_membership(project) is False |
| 807 | assert result.has_global_access is False |
| 808 | |
| 809 | |
| 810 | @all_silo_test |
nothing calls this directly
no test coverage detected