test UserPreferencesView

This commit is contained in:
imperosol
2025-11-25 19:48:45 +01:00
parent 1911f2e6dd
commit e9fbac8264
2 changed files with 17 additions and 4 deletions

View File

@@ -427,6 +427,19 @@ class TestUserQuerySetViewableBy:
assert not viewable.exists()
@pytest.mark.django_db
def test_user_preferences(client: Client):
user = subscriber_user.make()
client.force_login(user)
url = reverse("core:user_prefs", kwargs={"user_id": user.id})
response = client.get(url)
assert response.status_code == 200
response = client.post(url, {"notify_on_click": "true"})
assertRedirects(response, url)
user.preferences.refresh_from_db()
assert user.preferences.notify_on_click is True
@pytest.mark.django_db
def test_user_stats(client: Client):
user = subscriber_user.make()