Initial roborto accounting implementation
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user