diff --git a/backend/tests/unit/test_auth_endpoints.py b/backend/tests/unit/test_auth_endpoints.py index ffc2c6d..0627134 100644 --- a/backend/tests/unit/test_auth_endpoints.py +++ b/backend/tests/unit/test_auth_endpoints.py @@ -314,7 +314,9 @@ class TestGoogleAuthorizeUrl: assert response.status_code == 200 data = response.json() assert "authorization_url" in data - assert "accounts.google.com" in data["authorization_url"] + assert data["authorization_url"].startswith( + "https://accounts.google.com/o/oauth2/v2/auth" + ) async def test_url_contains_redirect_uri(self, anon_client): redirect = "http://myapp.example.com/callback" diff --git a/backend/tests/unit/test_gmail_labels.py b/backend/tests/unit/test_gmail_labels.py index 08cab79..166820b 100644 --- a/backend/tests/unit/test_gmail_labels.py +++ b/backend/tests/unit/test_gmail_labels.py @@ -77,7 +77,7 @@ class TestExtractGrantedScopes: def test_dict_format(self): data = {"granted_scopes": ["https://mail.google.com/", "openid"]} result = extract_granted_scopes(data) - assert "https://mail.google.com/" in result + assert result == ["https://mail.google.com/", "openid"] def test_dict_missing_granted_scopes(self): result = extract_granted_scopes({}) @@ -124,7 +124,7 @@ class TestBuildGmailCredentialScopes: ) assert "granted_scopes" in result assert "import_label_templates" in result - assert "https://mail.google.com/" in result["granted_scopes"] + assert result["granted_scopes"] == ["https://mail.google.com/"] def test_none_granted_scopes(self): result = build_gmail_credential_scopes(None)