22 lines
501 B
Python
22 lines
501 B
Python
from domain.item.models import Item
|
|
from domain.job.models import Job
|
|
|
|
|
|
def test_item_defaults():
|
|
item = Item(name="widget")
|
|
assert item.quantity == 1
|
|
|
|
|
|
def test_job_defaults():
|
|
job = Job(name="sync")
|
|
assert job.status == "pending"
|
|
assert job.retry_count == 0
|
|
assert job.error_message is None
|
|
|
|
|
|
def test_job_rejects_unknown_status():
|
|
try:
|
|
Job(name="sync", status="exploded")
|
|
except Exception:
|
|
return
|
|
raise AssertionError("status should be rejected") |