opencompletion.com/tests/integration
Russell Ballestrini aefb7005d1 Fix integration test failures - attempts increment and app context
Fixed 3 critical issues:

1. SQLAlchemy 'already registered' error in test_app_activity_functions.py:
   - Removed access to db.engine before app context was pushed (line 39)
   - Moved db.engine.dispose() to after context.push() (line 54)
   - Removed unnecessary init_activity_module() call in tests
   - Fixes 9 'Working outside of application context' errors

2. Attempts counter not incrementing for incorrect answers:
   - Added 'incorrect' to list of categories that stay on current step
   - Previously 'incorrect' was entering navigation block incorrectly
   - Now properly goes to ELSE block which increments attempts
   - Fixed in activity.py line 1082

Test Results:
- Before: 10 failed, 31 passed
- After: 2 failed, 39 passed
- Remaining 2 failures are minor socketio mocking issues (unrelated)
- Core functionality tests (attempts increment, correct navigation) now pass

Root Cause:
The activity.py logic assumed any category NOT in the special list should
try to navigate forward. But 'incorrect' should stay on the current step
and increment attempts, not try to find the next step.
2025-11-10 16:56:39 -05:00
..
test_activity_integration.py Fix remaining integration test failures 2025-11-10 16:30:06 -05:00
test_activity_processing.py Fix integration test failures 2025-11-10 16:06:59 -05:00
test_app_activity_functions.py Fix integration test failures - attempts increment and app context 2025-11-10 16:56:39 -05:00
test_app_integration.py Run black formatter on all Python files 2025-11-10 19:37:05 +00:00
test_multiple_activities.py Integrate comprehensive testing framework with Makefile 2025-08-10 19:38:50 -04:00