Files
vrobbler/tests/trends_tests
Colin Powell c21d6f5668 fix(tests): fix fasting custom threshold tests using Django ORM cache
The user_with_custom_thresholds fixture used UserProfile.objects.get_or_create()
which returns a separate Python instance from the one cached in
user._state.fields_cache['profile']. When the fixture modified and saved
the get_or_create instance, the cached instance on the user object still
held default values (periodic=16, full=24). compute_fasting() accessed
u.profile which returned the stale cached object.

Fixed by modifying through u.profile directly, which operates on the
same cached instance. Also applied black formatting to fasting.py.
2026-07-19 13:50:54 -04:00
..