Settings API and schema for now_playing_mode (phase 4, step 4)
CI / lint (push) Successful in 13s
CI / validate-monitoring (push) Successful in 40s
CI / federation-interop (push) Successful in 1m8s
CI / test (push) Successful in 3m39s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 6s

now_playing_mode was already in sharing.EDITABLE (step 1), so
_settings_body() was already returning it - but SharingSettingsSchema
never declared the field, so marshmallow was silently dropping it from
every response. Same class of gap phase 3 hit with timezone/
post_weekly_summary/post_milestones.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
This commit is contained in:
mattandClaude Sonnet 5 committed 2026-09-26 17:15:51 +01:00
1 parent ba30d5cb15
commit 515acae233
3 files changed
+53 -3

No files matched your search

+21
View File
@@ -56,6 +56,27 @@ def test_an_unknown_timezone_is_rejected(fed_client, fed_auth):
assert response.status_code == 422
def test_now_playing_mode_defaults_to_off(fed_client, fed_auth):
body = fed_client.get("/api/v1/federation/settings", headers=fed_auth).get_json()
assert body["now_playing_mode"] == "off"
@pytest.mark.parametrize("mode", ["off", "profile", "posts"])
def test_now_playing_mode_can_be_changed(fed_client, fed_auth, mode):
response = fed_client.patch(
"/api/v1/federation/settings", json={"now_playing_mode": mode}, headers=fed_auth
)
assert response.status_code == 200
assert response.get_json()["now_playing_mode"] == mode
def test_an_unknown_now_playing_mode_is_rejected(fed_client, fed_auth):
response = fed_client.patch(
"/api/v1/federation/settings", json={"now_playing_mode": "always"}, headers=fed_auth
)
assert response.status_code == 422
def test_enable_and_change_settings(fed_client, fed_auth, metric_delta):
enabled = metric_delta("scrobbler_federation_sharing_changes_total", change="enabled")
response = fed_client.patch(