Added 5 critical tests for order status transitions

Tests cover:
1. Multiple status transitions (draft->completed->cancelled->completed)
2. Cancellation from draft (reservation release)
3. Un-cancellation to pending (reservation restore)
4. Creating order with intermediate status
5. Rollback from completed to draft

Each test verifies:
- Stock state (available, reserved, free)
- Reservation status transitions
- Sale creation/deletion without duplicates
- StockBatch quantity changes

Files:
- inventory/tests/test_order_status_transitions.py (570 lines)
- inventory/tests/README.md (138 lines)
- inventory/tests/__init__.py
- run_status_tests.bat (launch script)
This commit is contained in:
2025-12-01 12:42:37 +03:00
parent 1168659df8
commit d023d1ab25
4 changed files with 717 additions and 0 deletions

10
run_status_tests.bat Normal file
View File

@@ -0,0 +1,10 @@
@echo off
REM Скрипт для запуска тестов переходов между статусами заказов
cd /d C:\Users\team_\Desktop\test_qwen
call .venv\Scripts\activate.bat
cd myproject
python manage.py test inventory.tests.test_order_status_transitions --verbosity=2
pause