add PictureQuerySet.viewable_by(user) method

This commit is contained in:
thomas girod
2024-08-06 12:37:50 +02:00
parent da6bd84cdf
commit 4506440a62
4 changed files with 25 additions and 12 deletions

View File

@ -75,7 +75,8 @@ class TestPictureSearch(TestSas):
assert [i["id"] for i in res.json()["results"]] == expected
def test_not_subscribed_user(self):
"""Test that a user that is not subscribed can only its own pictures."""
"""Test that a user that never subscribed can only its own pictures."""
self.user_a.subscriptions.all().delete()
self.client.force_login(self.user_a)
res = self.client.get(
reverse("api:pictures") + f"?users_identified={self.user_a.id}"