diff --git a/src/backend/core/tests/documents/test_api_documents_favorite.py b/src/backend/core/tests/documents/test_api_documents_favorite.py index e0359b3d..831f5e9e 100644 --- a/src/backend/core/tests/documents/test_api_documents_favorite.py +++ b/src/backend/core/tests/documents/test_api_documents_favorite.py @@ -45,7 +45,10 @@ def test_api_document_favorite_anonymous_user(method, reach): ], ) def test_api_document_favorite_authenticated_post_allowed(reach, has_role): - """Authenticated users should be able to mark a document as favorite using POST.""" + """ + Authenticated users should be able to mark a document to which they have access + as favorite using POST. + """ user = factories.UserFactory() document = factories.DocumentFactory(link_reach=reach) client = APIClient() @@ -69,7 +72,10 @@ def test_api_document_favorite_authenticated_post_allowed(reach, has_role): def test_api_document_favorite_authenticated_post_forbidden(): - """Authenticated users should be able to mark a document as favorite using POST.""" + """ + Authenticated users should not be allowed to mark a document to which they don't + have access as favorite using POST. + """ user = factories.UserFactory() document = factories.DocumentFactory(link_reach="restricted") client = APIClient() diff --git a/src/backend/core/tests/documents/test_api_documents_favorite_list.py b/src/backend/core/tests/documents/test_api_documents_favorite_list.py index 7b9f5ec0..544ff1b3 100644 --- a/src/backend/core/tests/documents/test_api_documents_favorite_list.py +++ b/src/backend/core/tests/documents/test_api_documents_favorite_list.py @@ -41,8 +41,8 @@ def test_api_document_favorite_list_authenticated_with_favorite(): client = APIClient() client.force_login(user) - # User don't have access to this document, let say it had access and this access has been - # removed. It should not be in the favorite list anymore. + # User don't have access to this document (e.g the user had access and this + # access was removed. It should not be in the favorite list anymore. factories.DocumentFactory(favorited_by=[user]) document = factories.UserDocumentAccessFactory(