diff --git a/fixtures/vsts.py b/fixtures/vsts.py index 76ad6d83519c3b..4c9f4678670f21 100644 --- a/fixtures/vsts.py +++ b/fixtures/vsts.py @@ -66,6 +66,17 @@ def _stub_vsts(self): }, ) + responses.add( + responses.POST, + "https://login.microsoftonline.com/common/oauth2/v2.0/token", + json={ + "access_token": self.access_token, + "token_type": "grant", + "expires_in": 300, # seconds (5 min) + "refresh_token": self.refresh_token, + }, + ) + responses.add( responses.GET, "https://app.vssps.visualstudio.com/_apis/accounts?memberId=%s&api-version=4.1" @@ -195,19 +206,27 @@ def assert_vsts_oauth_redirect(self, redirect): assert redirect.netloc == "app.vssps.visualstudio.com" assert redirect.path == "/oauth2/authorize" + def assert_vsts_new_oauth_redirect(self, redirect): + assert redirect.scheme == "https" + assert redirect.netloc == "login.microsoftonline.com" + assert redirect.path == "/common/oauth2/v2.0/authorize" + def assert_account_selection(self, response, account_id=None): account_id = account_id or self.vsts_account_id assert response.status_code == 200 assert f'