22 lines
520 B
Python
22 lines
520 B
Python
from datetime import UTC
|
|
from uuid import UUID
|
|
|
|
from mka.models.base import DomainModel
|
|
|
|
|
|
def test_domain_model_creates_uuid_and_utc_timestamps() -> None:
|
|
model = DomainModel()
|
|
|
|
assert isinstance(model.id, UUID)
|
|
assert model.created_at.tzinfo is UTC
|
|
assert model.updated_at.tzinfo is UTC
|
|
|
|
|
|
def test_domain_model_json_roundtrip() -> None:
|
|
original = DomainModel()
|
|
|
|
serialized = original.model_dump_json()
|
|
restored = DomainModel.model_validate_json(serialized)
|
|
|
|
assert restored == original
|