[Invoices] Test Setup (Mock) #190
Labels
No labels
CI/CD
MongoDB
PostgreSQL
api
authentication
bug
documentation
duplicate
enhancement
example issue
fix
good first issue
help wanted
high-level requirement
infrastructure
invalid
low-level requirement
medium-level requirement
question
security
test
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AndreFerreira5/starranja#190
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Create
tests/test_routes/test_invoices.py.Configure
AsyncMockforInvoiceRepo.Test Create (Emission):
test_create_invoice_success(201 Created - returns full snapshot).test_create_invoice_missing_address(Mock repo raisingClientAddressMissingError, expect 400).test_create_invoice_work_order_not_found(Expect 404 if WO doesn't exist - logic inside Repo or Service).Test Read:
test_get_invoice_by_id_success(200 OK).test_get_invoice_by_id_not_found(Mock repo returningNoneor raising error, expect 404).Test Read (Filters):
test_get_invoices_by_client(Mockrepo.get_invoices_by_client_id, expect 200).test_get_invoices_by_work_order(Mockrepo.get_invoices_by_work_order_id, expect 200).Test Update (Status):
test_update_invoice_status_success(200 OK - e.g., marking as PAID).test_update_invoice_not_found(Expect 404).