15 lines
523 B
Python
15 lines
523 B
Python
from roborto_accounting.domain.clients import snapshot_client
|
|
from roborto_accounting.persistence.models import Client
|
|
|
|
def test_client_snapshot_is_immutable_and_independent():
|
|
client = Client(name="Example Ltd", email="old@example.test")
|
|
snapshot = snapshot_client(client)
|
|
client.email = "new@example.test"
|
|
assert snapshot.email == "old@example.test"
|
|
try:
|
|
snapshot.name = "Changed"
|
|
except Exception:
|
|
pass
|
|
else:
|
|
raise AssertionError("client snapshots must be immutable")
|