✅(backend) fix wrong docstrings in tests for favorite documents
This was most likely due to copy pasta fail.
This commit is contained in:
@@ -45,7 +45,10 @@ def test_api_document_favorite_anonymous_user(method, reach):
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_api_document_favorite_authenticated_post_allowed(reach, has_role):
|
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()
|
user = factories.UserFactory()
|
||||||
document = factories.DocumentFactory(link_reach=reach)
|
document = factories.DocumentFactory(link_reach=reach)
|
||||||
client = APIClient()
|
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():
|
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()
|
user = factories.UserFactory()
|
||||||
document = factories.DocumentFactory(link_reach="restricted")
|
document = factories.DocumentFactory(link_reach="restricted")
|
||||||
client = APIClient()
|
client = APIClient()
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ def test_api_document_favorite_list_authenticated_with_favorite():
|
|||||||
client = APIClient()
|
client = APIClient()
|
||||||
client.force_login(user)
|
client.force_login(user)
|
||||||
|
|
||||||
# User don't have access to this document, let say it had access and this access has been
|
# User don't have access to this document (e.g the user had access and this
|
||||||
# removed. It should not be in the favorite list anymore.
|
# access was removed. It should not be in the favorite list anymore.
|
||||||
factories.DocumentFactory(favorited_by=[user])
|
factories.DocumentFactory(favorited_by=[user])
|
||||||
|
|
||||||
document = factories.UserDocumentAccessFactory(
|
document = factories.UserDocumentAccessFactory(
|
||||||
|
|||||||
Reference in New Issue
Block a user