test_auth_backends: Fix SOCIAL_AUTH_GITHUB_TEAM_ID mock.

SOCIAL_AUTH_GITHUB_TEAM_ID is expected to be the string of an integer.

The requests mock for the bogus /None URL is unused because the
function that would request it is itself mocked.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-09-08 13:39:01 -07:00 committed by Tim Abbott
parent 6f5346cc7d
commit 4c38b1371b
1 changed files with 2 additions and 9 deletions

View File

@ -3610,13 +3610,6 @@ class GitHubAuthBackendTest(SocialAuthBase):
body=json.dumps(email_data), body=json.dumps(email_data),
) )
requests_mock.add(
requests_mock.GET,
"https://api.github.com/teams/zulip-webapp/members/None",
status=200,
body=json.dumps(email_data),
)
self.email_data = email_data self.email_data = email_data
def get_account_data_dict( def get_account_data_dict(
@ -3647,7 +3640,7 @@ class GitHubAuthBackendTest(SocialAuthBase):
], ],
) )
@override_settings(SOCIAL_AUTH_GITHUB_TEAM_ID="zulip-webapp") @override_settings(SOCIAL_AUTH_GITHUB_TEAM_ID="51246")
def test_social_auth_github_team_not_member_failed(self) -> None: def test_social_auth_github_team_not_member_failed(self) -> None:
account_data_dict = self.get_account_data_dict(email=self.email, name=self.name) account_data_dict = self.get_account_data_dict(email=self.email, name=self.name)
subdomain = "zulip" subdomain = "zulip"
@ -3669,7 +3662,7 @@ class GitHubAuthBackendTest(SocialAuthBase):
], ],
) )
@override_settings(SOCIAL_AUTH_GITHUB_TEAM_ID="zulip-webapp") @override_settings(SOCIAL_AUTH_GITHUB_TEAM_ID="51247")
def test_social_auth_github_team_member_success(self) -> None: def test_social_auth_github_team_member_success(self) -> None:
account_data_dict = self.get_account_data_dict(email=self.email, name=self.name) account_data_dict = self.get_account_data_dict(email=self.email, name=self.name)
with mock.patch( with mock.patch(