From 3431022d46ed51ab21389f9b47797efff6886725 Mon Sep 17 00:00:00 2001 From: Adam Jenkins Date: Thu, 31 Jul 2025 12:01:14 -0300 Subject: [PATCH 1/5] Add organization domains module --- tests/test_organization_domains.py | 135 +++++++++++++ tests/utils/fixtures/mock_organization.py | 2 +- workos/_base_client.py | 5 + workos/async_client.py | 9 + workos/client.py | 9 + workos/organization_domains.py | 180 ++++++++++++++++++ workos/types/events/event.py | 2 +- workos/types/events/event_model.py | 2 +- ...tion_domain_verification_failed_payload.py | 2 +- workos/types/organization_domains/__init__.py | 1 + .../organization_domain.py | 0 workos/types/organizations/__init__.py | 2 +- workos/types/organizations/organization.py | 2 +- .../organizations/organization_common.py | 2 +- workos/types/webhooks/webhook.py | 2 +- 15 files changed, 347 insertions(+), 8 deletions(-) create mode 100644 tests/test_organization_domains.py create mode 100644 workos/organization_domains.py create mode 100644 workos/types/organization_domains/__init__.py rename workos/types/{organizations => organization_domains}/organization_domain.py (100%) diff --git a/tests/test_organization_domains.py b/tests/test_organization_domains.py new file mode 100644 index 00000000..1893ba97 --- /dev/null +++ b/tests/test_organization_domains.py @@ -0,0 +1,135 @@ +import datetime +from typing import Union +import pytest +from tests.utils.syncify import syncify +from workos.organization_domains import AsyncOrganizationDomains, OrganizationDomains + + +@pytest.mark.sync_and_async(OrganizationDomains, AsyncOrganizationDomains) +class TestOrganizationDomains: + @pytest.fixture(autouse=True) + def setup(self, module_instance: Union[OrganizationDomains, AsyncOrganizationDomains]): + self.http_client = module_instance._http_client + self.organization_domains = module_instance + + @pytest.fixture + def mock_organization_domain(self): + return { + "object": "organization_domain", + "id": "org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8", + "organization_id": "org_01EHT88Z8J8795GZNQ4ZP1J81T", + "domain": "example.com", + "state": "pending", + "verification_strategy": "dns", + "verification_token": "workos_example_verification_token_12345", + "verification_prefix": "_workos-challenge", + "created_at": datetime.datetime.now().isoformat(), + "updated_at": datetime.datetime.now().isoformat(), + } + + @pytest.fixture + def mock_organization_domain_verified(self): + return { + "object": "organization_domain", + "id": "org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8", + "organization_id": "org_01EHT88Z8J8795GZNQ4ZP1J81T", + "domain": "example.com", + "state": "verified", + "verification_strategy": "dns", + "verification_token": "workos_example_verification_token_12345", + "verification_prefix": "_workos-challenge", + "created_at": datetime.datetime.now().isoformat(), + "updated_at": datetime.datetime.now().isoformat(), + } + + def test_get_organization_domain( + self, capture_and_mock_http_client_request, mock_organization_domain + ): + request_kwargs = capture_and_mock_http_client_request( + self.http_client, + mock_organization_domain, + 200, + ) + + organization_domain = syncify( + self.organization_domains.get_organization_domain( + organization_domain_id="org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8" + ) + ) + + assert request_kwargs["url"].endswith( + "/organization_domains/org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8" + ) + assert request_kwargs["method"] == "get" + assert organization_domain.id == "org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8" + assert organization_domain.domain == "example.com" + assert organization_domain.state == "pending" + assert organization_domain.verification_strategy == "dns" + + def test_create_organization_domain( + self, capture_and_mock_http_client_request, mock_organization_domain + ): + request_kwargs = capture_and_mock_http_client_request( + self.http_client, + mock_organization_domain, + 201, + ) + + organization_domain = syncify( + self.organization_domains.create_organization_domain( + organization_id="org_01EHT88Z8J8795GZNQ4ZP1J81T", + domain="example.com", + ) + ) + + assert request_kwargs["url"].endswith("/organization_domains") + assert request_kwargs["method"] == "post" + assert request_kwargs["json"] == { + "organization_id": "org_01EHT88Z8J8795GZNQ4ZP1J81T", + "domain": "example.com", + } + assert organization_domain.id == "org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8" + assert organization_domain.domain == "example.com" + assert organization_domain.organization_id == "org_01EHT88Z8J8795GZNQ4ZP1J81T" + + def test_verify_organization_domain( + self, capture_and_mock_http_client_request, mock_organization_domain_verified + ): + request_kwargs = capture_and_mock_http_client_request( + self.http_client, + mock_organization_domain_verified, + 200, + ) + + organization_domain = syncify( + self.organization_domains.verify_organization_domain( + organization_domain_id="org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8" + ) + ) + + assert request_kwargs["url"].endswith( + "/organization_domains/org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8/verify" + ) + assert request_kwargs["method"] == "post" + assert organization_domain.id == "org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8" + assert organization_domain.state == "verified" + + def test_delete_organization_domain(self, capture_and_mock_http_client_request): + request_kwargs = capture_and_mock_http_client_request( + self.http_client, + None, + 204, + headers={"content-type": "text/plain; charset=utf-8"}, + ) + + response = syncify( + self.organization_domains.delete_organization_domain( + organization_domain_id="org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8" + ) + ) + + assert request_kwargs["url"].endswith( + "/organization_domains/org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8" + ) + assert request_kwargs["method"] == "delete" + assert response is None \ No newline at end of file diff --git a/tests/utils/fixtures/mock_organization.py b/tests/utils/fixtures/mock_organization.py index d401a398..08e7044b 100644 --- a/tests/utils/fixtures/mock_organization.py +++ b/tests/utils/fixtures/mock_organization.py @@ -1,7 +1,7 @@ import datetime from workos.types.organizations import Organization -from workos.types.organizations.organization_domain import OrganizationDomain +from workos.types.organization_domains import OrganizationDomain class MockOrganization(Organization): diff --git a/workos/_base_client.py b/workos/_base_client.py index 41f31a66..d805a80a 100644 --- a/workos/_base_client.py +++ b/workos/_base_client.py @@ -11,6 +11,7 @@ from workos.events import EventsModule from workos.mfa import MFAModule from workos.organizations import OrganizationsModule +from workos.organization_domains import OrganizationDomainsModule from workos.passwordless import PasswordlessModule from workos.portal import PortalModule from workos.sso import SSOModule @@ -88,6 +89,10 @@ def mfa(self) -> MFAModule: ... @abstractmethod def organizations(self) -> OrganizationsModule: ... + @property + @abstractmethod + def organization_domains(self) -> OrganizationDomainsModule: ... + @property @abstractmethod def passwordless(self) -> PasswordlessModule: ... diff --git a/workos/async_client.py b/workos/async_client.py index 88bab964..920c08ab 100644 --- a/workos/async_client.py +++ b/workos/async_client.py @@ -7,6 +7,7 @@ from workos.fga import FGAModule from workos.mfa import MFAModule from workos.organizations import AsyncOrganizations +from workos.organization_domains import AsyncOrganizationDomains from workos.passwordless import PasswordlessModule from workos.portal import PortalModule from workos.sso import AsyncSSO @@ -80,6 +81,14 @@ def organizations(self) -> AsyncOrganizations: self._organizations = AsyncOrganizations(self._http_client) return self._organizations + @property + def organization_domains(self) -> AsyncOrganizationDomains: + if not getattr(self, "_organization_domains", None): + self._organization_domains = AsyncOrganizationDomains( + http_client=self._http_client, client_configuration=self + ) + return self._organization_domains + @property def passwordless(self) -> PasswordlessModule: raise NotImplementedError( diff --git a/workos/client.py b/workos/client.py index 8c6c809c..9c4aa154 100644 --- a/workos/client.py +++ b/workos/client.py @@ -5,6 +5,7 @@ from workos.directory_sync import DirectorySync from workos.fga import FGA from workos.organizations import Organizations +from workos.organization_domains import OrganizationDomains from workos.passwordless import Passwordless from workos.portal import Portal from workos.sso import SSO @@ -80,6 +81,14 @@ def organizations(self) -> Organizations: self._organizations = Organizations(self._http_client) return self._organizations + @property + def organization_domains(self) -> OrganizationDomains: + if not getattr(self, "_organization_domains", None): + self._organization_domains = OrganizationDomains( + http_client=self._http_client, client_configuration=self + ) + return self._organization_domains + @property def passwordless(self) -> Passwordless: if not getattr(self, "_passwordless", None): diff --git a/workos/organization_domains.py b/workos/organization_domains.py new file mode 100644 index 00000000..4a430960 --- /dev/null +++ b/workos/organization_domains.py @@ -0,0 +1,180 @@ +from typing import Optional, Protocol +from workos._client_configuration import ClientConfiguration +from workos.types.organization_domains import OrganizationDomain +from workos.typing.sync_or_async import SyncOrAsync +from workos.utils.http_client import AsyncHTTPClient, SyncHTTPClient +from workos.utils.request_helper import ( + REQUEST_METHOD_DELETE, + REQUEST_METHOD_GET, + REQUEST_METHOD_POST, + RequestHelper, +) + + +class OrganizationDomainsModule(Protocol): + """Offers methods for managing organization domains.""" + + _client_configuration: ClientConfiguration + + def get_organization_domain( + self, organization_domain_id: str + ) -> SyncOrAsync[OrganizationDomain]: + """Gets a single Organization Domain + + Args: + organization_domain_id (str): Organization Domain unique identifier + + Returns: + OrganizationDomain: Organization Domain response from WorkOS + """ + ... + + def create_organization_domain( + self, + organization_id: str, + domain: str, + ) -> SyncOrAsync[OrganizationDomain]: + """Creates an Organization Domain + + Args: + organization_id (str): Organization unique identifier + domain (str): Domain to be added to the organization + + Returns: + OrganizationDomain: Organization Domain response from WorkOS + """ + ... + + def verify_organization_domain( + self, organization_domain_id: str + ) -> SyncOrAsync[OrganizationDomain]: + """Verifies an Organization Domain + + Args: + organization_domain_id (str): Organization Domain unique identifier + + Returns: + OrganizationDomain: Organization Domain response from WorkOS + """ + ... + + def delete_organization_domain( + self, organization_domain_id: str + ) -> SyncOrAsync[None]: + """Deletes a single Organization Domain + + Args: + organization_domain_id (str): Organization Domain unique identifier + + Returns: + None + """ + ... + + +class OrganizationDomains: + """Offers methods for managing organization domains.""" + + _http_client: SyncHTTPClient + _client_configuration: ClientConfiguration + + def __init__( + self, + http_client: SyncHTTPClient, + client_configuration: ClientConfiguration, + ): + self._http_client = http_client + self._client_configuration = client_configuration + + def get_organization_domain( + self, organization_domain_id: str + ) -> OrganizationDomain: + response = self._http_client.request( + f"organization_domains/{organization_domain_id}", + method=REQUEST_METHOD_GET, + ) + + return OrganizationDomain.model_validate(response) + + def create_organization_domain( + self, + organization_id: str, + domain: str, + ) -> OrganizationDomain: + response = self._http_client.request( + "organization_domains", + method=REQUEST_METHOD_POST, + json={"organization_id": organization_id, "domain": domain}, + ) + + return OrganizationDomain.model_validate(response) + + def verify_organization_domain( + self, organization_domain_id: str + ) -> OrganizationDomain: + response = self._http_client.request( + f"organization_domains/{organization_domain_id}/verify", + method=REQUEST_METHOD_POST, + ) + + return OrganizationDomain.model_validate(response) + + def delete_organization_domain(self, organization_domain_id: str) -> None: + self._http_client.request( + f"organization_domains/{organization_domain_id}", + method=REQUEST_METHOD_DELETE, + ) + + +class AsyncOrganizationDomains: + """Offers async methods for managing organization domains.""" + + _http_client: AsyncHTTPClient + _client_configuration: ClientConfiguration + + def __init__( + self, + http_client: AsyncHTTPClient, + client_configuration: ClientConfiguration, + ): + self._http_client = http_client + self._client_configuration = client_configuration + + async def get_organization_domain( + self, organization_domain_id: str + ) -> OrganizationDomain: + response = await self._http_client.request( + f"organization_domains/{organization_domain_id}", + method=REQUEST_METHOD_GET, + ) + + return OrganizationDomain.model_validate(response) + + async def create_organization_domain( + self, + organization_id: str, + domain: str, + ) -> OrganizationDomain: + response = await self._http_client.request( + "organization_domains", + method=REQUEST_METHOD_POST, + json={"organization_id": organization_id, "domain": domain}, + ) + + return OrganizationDomain.model_validate(response) + + async def verify_organization_domain( + self, organization_domain_id: str + ) -> OrganizationDomain: + response = await self._http_client.request( + f"organization_domains/{organization_domain_id}/verify", + method=REQUEST_METHOD_POST, + ) + + return OrganizationDomain.model_validate(response) + + async def delete_organization_domain(self, organization_domain_id: str) -> None: + await self._http_client.request( + f"organization_domains/{organization_domain_id}", + method=REQUEST_METHOD_DELETE, + ) \ No newline at end of file diff --git a/workos/types/events/event.py b/workos/types/events/event.py index 26b1826d..c6a698fe 100644 --- a/workos/types/events/event.py +++ b/workos/types/events/event.py @@ -38,7 +38,7 @@ ) from workos.types.events.session_created_payload import SessionCreatedPayload from workos.types.organizations.organization_common import OrganizationCommon -from workos.types.organizations.organization_domain import OrganizationDomain +from workos.types.organization_domains import OrganizationDomain from workos.types.roles.role import EventRole from workos.types.sso.connection import Connection from workos.types.user_management.email_verification import ( diff --git a/workos/types/events/event_model.py b/workos/types/events/event_model.py index 60612bd0..24443a52 100644 --- a/workos/types/events/event_model.py +++ b/workos/types/events/event_model.py @@ -37,7 +37,7 @@ ) from workos.types.events.session_created_payload import SessionCreatedPayload from workos.types.organizations.organization_common import OrganizationCommon -from workos.types.organizations.organization_domain import OrganizationDomain +from workos.types.organization_domains import OrganizationDomain from workos.types.roles.role import EventRole from workos.types.sso.connection import Connection from workos.types.user_management.email_verification import ( diff --git a/workos/types/events/organization_domain_verification_failed_payload.py b/workos/types/events/organization_domain_verification_failed_payload.py index 2f2a8e22..1df3a061 100644 --- a/workos/types/events/organization_domain_verification_failed_payload.py +++ b/workos/types/events/organization_domain_verification_failed_payload.py @@ -1,6 +1,6 @@ from typing import Literal from workos.types.workos_model import WorkOSModel -from workos.types.organizations.organization_domain import OrganizationDomain +from workos.types.organization_domains import OrganizationDomain from workos.typing.literals import LiteralOrUntyped diff --git a/workos/types/organization_domains/__init__.py b/workos/types/organization_domains/__init__.py new file mode 100644 index 00000000..b4544074 --- /dev/null +++ b/workos/types/organization_domains/__init__.py @@ -0,0 +1 @@ +from .organization_domain import * \ No newline at end of file diff --git a/workos/types/organizations/organization_domain.py b/workos/types/organization_domains/organization_domain.py similarity index 100% rename from workos/types/organizations/organization_domain.py rename to workos/types/organization_domains/organization_domain.py diff --git a/workos/types/organizations/__init__.py b/workos/types/organizations/__init__.py index e46d02fa..b5ae96a0 100644 --- a/workos/types/organizations/__init__.py +++ b/workos/types/organizations/__init__.py @@ -1,4 +1,4 @@ from .domain_data_input import * from .organization_common import * -from .organization_domain import * from .organization import * +from workos.types.organization_domains import OrganizationDomain diff --git a/workos/types/organizations/organization.py b/workos/types/organizations/organization.py index 74846aee..d7ba0aa4 100644 --- a/workos/types/organizations/organization.py +++ b/workos/types/organizations/organization.py @@ -2,7 +2,7 @@ from typing import Optional, Sequence from workos.types.metadata import Metadata from workos.types.organizations.organization_common import OrganizationCommon -from workos.types.organizations.organization_domain import OrganizationDomain +from workos.types.organization_domains import OrganizationDomain class Organization(OrganizationCommon): diff --git a/workos/types/organizations/organization_common.py b/workos/types/organizations/organization_common.py index e71aeb24..10a4c5c2 100644 --- a/workos/types/organizations/organization_common.py +++ b/workos/types/organizations/organization_common.py @@ -1,6 +1,6 @@ from typing import Literal, Sequence from workos.types.workos_model import WorkOSModel -from workos.types.organizations.organization_domain import OrganizationDomain +from workos.types.organization_domains import OrganizationDomain class OrganizationCommon(WorkOSModel): diff --git a/workos/types/webhooks/webhook.py b/workos/types/webhooks/webhook.py index 89a0b02a..eadd8683 100644 --- a/workos/types/webhooks/webhook.py +++ b/workos/types/webhooks/webhook.py @@ -38,7 +38,7 @@ ) from workos.types.events.session_created_payload import SessionCreatedPayload from workos.types.organizations.organization_common import OrganizationCommon -from workos.types.organizations.organization_domain import OrganizationDomain +from workos.types.organization_domains import OrganizationDomain from workos.types.roles.role import EventRole from workos.types.sso.connection import Connection from workos.types.user_management.email_verification import ( From b76a755883f7b3aa97fe6c73963d698cba6a4d95 Mon Sep 17 00:00:00 2001 From: Adam Jenkins Date: Thu, 31 Jul 2025 12:05:19 -0300 Subject: [PATCH 2/5] Formatting --- tests/test_organization_domains.py | 6 ++++-- workos/organization_domains.py | 2 +- workos/types/organization_domains/__init__.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_organization_domains.py b/tests/test_organization_domains.py index 1893ba97..512279a5 100644 --- a/tests/test_organization_domains.py +++ b/tests/test_organization_domains.py @@ -8,7 +8,9 @@ @pytest.mark.sync_and_async(OrganizationDomains, AsyncOrganizationDomains) class TestOrganizationDomains: @pytest.fixture(autouse=True) - def setup(self, module_instance: Union[OrganizationDomains, AsyncOrganizationDomains]): + def setup( + self, module_instance: Union[OrganizationDomains, AsyncOrganizationDomains] + ): self.http_client = module_instance._http_client self.organization_domains = module_instance @@ -132,4 +134,4 @@ def test_delete_organization_domain(self, capture_and_mock_http_client_request): "/organization_domains/org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8" ) assert request_kwargs["method"] == "delete" - assert response is None \ No newline at end of file + assert response is None diff --git a/workos/organization_domains.py b/workos/organization_domains.py index 4a430960..5f782544 100644 --- a/workos/organization_domains.py +++ b/workos/organization_domains.py @@ -177,4 +177,4 @@ async def delete_organization_domain(self, organization_domain_id: str) -> None: await self._http_client.request( f"organization_domains/{organization_domain_id}", method=REQUEST_METHOD_DELETE, - ) \ No newline at end of file + ) diff --git a/workos/types/organization_domains/__init__.py b/workos/types/organization_domains/__init__.py index b4544074..efdc7d2d 100644 --- a/workos/types/organization_domains/__init__.py +++ b/workos/types/organization_domains/__init__.py @@ -1 +1 @@ -from .organization_domain import * \ No newline at end of file +from .organization_domain import * From d54a40d20135fe4d49dc75b936c71fd4fddd731f Mon Sep 17 00:00:00 2001 From: Adam Jenkins Date: Thu, 31 Jul 2025 13:29:51 -0300 Subject: [PATCH 3/5] Remove unreleased method --- tests/test_organizations.py | 19 ------------------- workos/organization_domains.py | 3 +-- workos/organizations.py | 25 ------------------------- 3 files changed, 1 insertion(+), 46 deletions(-) diff --git a/tests/test_organizations.py b/tests/test_organizations.py index 789da120..87598466 100644 --- a/tests/test_organizations.py +++ b/tests/test_organizations.py @@ -218,25 +218,6 @@ def test_delete_organization(self, capture_and_mock_http_client_request): assert request_kwargs["method"] == "delete" assert response is None - def test_delete_organization_domain(self, capture_and_mock_http_client_request): - request_kwargs = capture_and_mock_http_client_request( - self.http_client, - 204, - headers={"content-type": "text/plain; charset=utf-8"}, - ) - - response = syncify( - self.organizations.delete_organization_domain( - organization_domain_id="org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8" - ) - ) - - assert request_kwargs["url"].endswith( - "/organization_domains/org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8" - ) - assert request_kwargs["method"] == "delete" - assert response is None - def test_list_organizations_auto_pagination_for_single_page( self, mock_organizations_single_page_response, diff --git a/workos/organization_domains.py b/workos/organization_domains.py index 5f782544..173fa17a 100644 --- a/workos/organization_domains.py +++ b/workos/organization_domains.py @@ -1,4 +1,4 @@ -from typing import Optional, Protocol +from typing import Protocol from workos._client_configuration import ClientConfiguration from workos.types.organization_domains import OrganizationDomain from workos.typing.sync_or_async import SyncOrAsync @@ -7,7 +7,6 @@ REQUEST_METHOD_DELETE, REQUEST_METHOD_GET, REQUEST_METHOD_POST, - RequestHelper, ) diff --git a/workos/organizations.py b/workos/organizations.py index 4c24b16c..f60ff703 100644 --- a/workos/organizations.py +++ b/workos/organizations.py @@ -128,19 +128,6 @@ def delete_organization(self, organization_id: str) -> SyncOrAsync[None]: """ ... - def delete_organization_domain( - self, organization_domain_id: str - ) -> SyncOrAsync[None]: - """Deletes a single Organization Domain - - Args: - organization_domain_id (str): Organization Domain unique identifier - - Returns: - None - """ - ... - class Organizations(OrganizationsModule): _http_client: SyncHTTPClient @@ -252,12 +239,6 @@ def delete_organization(self, organization_id: str) -> None: method=REQUEST_METHOD_DELETE, ) - def delete_organization_domain(self, organization_domain_id: str) -> None: - self._http_client.request( - f"organization_domains/{organization_domain_id}", - method=REQUEST_METHOD_DELETE, - ) - def list_organization_roles(self, organization_id: str) -> RoleList: response = self._http_client.request( f"organizations/{organization_id}/roles", @@ -377,12 +358,6 @@ async def delete_organization(self, organization_id: str) -> None: method=REQUEST_METHOD_DELETE, ) - async def delete_organization_domain(self, organization_domain_id: str) -> None: - await self._http_client.request( - f"organization_domains/{organization_domain_id}", - method=REQUEST_METHOD_DELETE, - ) - async def list_organization_roles(self, organization_id: str) -> RoleList: response = await self._http_client.request( f"organizations/{organization_id}/roles", From 1e3244c82661af8dc908e5fd601f46542b38261d Mon Sep 17 00:00:00 2001 From: Adam Jenkins Date: Thu, 31 Jul 2025 15:32:01 -0300 Subject: [PATCH 4/5] Add backwards compat --- workos/types/organizations/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/workos/types/organizations/__init__.py b/workos/types/organizations/__init__.py index b5ae96a0..71655a2e 100644 --- a/workos/types/organizations/__init__.py +++ b/workos/types/organizations/__init__.py @@ -1,4 +1,6 @@ from .domain_data_input import * from .organization_common import * from .organization import * + +# re-exported for backwards compatibility, can be removed after version 6.0.0 from workos.types.organization_domains import OrganizationDomain From 081c66266dc351e1c4a310c65f230c660effe002 Mon Sep 17 00:00:00 2001 From: Adam Jenkins Date: Thu, 31 Jul 2025 15:34:39 -0300 Subject: [PATCH 5/5] address greptile --- tests/test_organization_domains.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test_organization_domains.py b/tests/test_organization_domains.py index 512279a5..cd61a590 100644 --- a/tests/test_organization_domains.py +++ b/tests/test_organization_domains.py @@ -1,4 +1,3 @@ -import datetime from typing import Union import pytest from tests.utils.syncify import syncify @@ -25,8 +24,8 @@ def mock_organization_domain(self): "verification_strategy": "dns", "verification_token": "workos_example_verification_token_12345", "verification_prefix": "_workos-challenge", - "created_at": datetime.datetime.now().isoformat(), - "updated_at": datetime.datetime.now().isoformat(), + "created_at": "2023-01-01T12:00:00.000Z", + "updated_at": "2023-01-01T12:00:00.000Z", } @pytest.fixture @@ -40,8 +39,8 @@ def mock_organization_domain_verified(self): "verification_strategy": "dns", "verification_token": "workos_example_verification_token_12345", "verification_prefix": "_workos-challenge", - "created_at": datetime.datetime.now().isoformat(), - "updated_at": datetime.datetime.now().isoformat(), + "created_at": "2023-01-01T12:00:00.000Z", + "updated_at": "2023-01-01T12:00:00.000Z", } def test_get_organization_domain(