Bootstrap Python project and add base domain model
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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
|
||||
Reference in New Issue
Block a user