mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-22 21:51:10 -05:00
Add test utilities and state machine diagrams for FSM models
- Introduced reusable test utilities in `backend/tests/utils` for FSM transitions, HTMX interactions, and common scenarios. - Added factory functions for creating test submissions, parks, rides, and photo submissions. - Implemented assertion helpers for verifying state changes, toast notifications, and transition logs. - Created comprehensive state machine diagrams for all FSM-enabled models in `docs/STATE_DIAGRAMS.md`, detailing states, transitions, and guard conditions.
This commit is contained in:
28
backend/tests/utils/__init__.py
Normal file
28
backend/tests/utils/__init__.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Test utilities for ThrillWiki.
|
||||
|
||||
This package provides reusable test utilities, helpers, and fixtures
|
||||
for testing FSM transitions, HTMX interactions, and other common scenarios.
|
||||
"""
|
||||
|
||||
from .fsm_test_helpers import (
|
||||
create_test_submission,
|
||||
create_test_park,
|
||||
create_test_ride,
|
||||
assert_status_changed,
|
||||
assert_state_log_created,
|
||||
assert_toast_triggered,
|
||||
wait_for_htmx_swap,
|
||||
verify_transition_buttons_visible,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"create_test_submission",
|
||||
"create_test_park",
|
||||
"create_test_ride",
|
||||
"assert_status_changed",
|
||||
"assert_state_log_created",
|
||||
"assert_toast_triggered",
|
||||
"wait_for_htmx_swap",
|
||||
"verify_transition_buttons_visible",
|
||||
]
|
||||
Reference in New Issue
Block a user