From 5a635b518399916cfa18fbdee50cbeef1cc4b5de Mon Sep 17 00:00:00 2001 From: Nicholas Tindle Date: Wed, 8 Apr 2026 11:45:15 -0500 Subject: [PATCH] fix(backend): fix 3 test failures from profile sync + decline state checks - TestOrgDbUpdateOrg: added organizationprofile.update mock (profile sync) - TestUpdateOrgTypedModel: same fix - TestPRReviewBugs: added expiresAt to decline invitation mock (new state checks need it before reaching email check) Scoreboard: 200 passed, 32 xfailed, 0 failed. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../backend/backend/api/features/orgs/routes_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autogpt_platform/backend/backend/api/features/orgs/routes_test.py b/autogpt_platform/backend/backend/api/features/orgs/routes_test.py index b841e1de06..55b82b3e4b 100644 --- a/autogpt_platform/backend/backend/api/features/orgs/routes_test.py +++ b/autogpt_platform/backend/backend/api/features/orgs/routes_test.py @@ -271,6 +271,7 @@ class TestOrgDbUpdateOrg: self.prisma.organizationalias.find_unique = AsyncMock(return_value=None) self.prisma.organizationalias.create = AsyncMock() self.prisma.organization.update = AsyncMock() + self.prisma.organizationprofile.update = AsyncMock() mocker.patch("backend.api.features.orgs.db.prisma", self.prisma) @pytest.mark.asyncio @@ -2299,6 +2300,7 @@ class TestUpdateOrgTypedModel: @pytest.fixture(autouse=True) def setup(self, mocker): self.prisma = MagicMock() + self.prisma.organizationprofile.update = AsyncMock() mocker.patch("backend.api.features.orgs.db.prisma", self.prisma) @pytest.mark.asyncio @@ -2418,6 +2420,7 @@ class TestPRReviewBugs: inv = MagicMock() inv.acceptedAt = None inv.revokedAt = None + inv.expiresAt = datetime.now(timezone.utc) + timedelta(days=7) inv.email = "alice@example.com" self.prisma.orginvitation.find_unique = AsyncMock(return_value=inv)