Skip to content

Commit

Permalink
Mock get_doi_csl for publication creation test (#2004)
Browse files Browse the repository at this point in the history
  • Loading branch information
amickan committed Sep 9, 2021
1 parent c358b15 commit 39f753f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/tests/publications_tests/test_views.py
Expand Up @@ -14,14 +14,18 @@


@pytest.mark.django_db
def test_publication_creation(client):
def test_publication_creation(client, mocker):
user1 = UserFactory()
user2 = get_anonymous_user()
g_reg = Group.objects.get(name=settings.REGISTERED_USERS_GROUP_NAME)

assert g_reg not in user2.groups.all()
assert Publication.objects.count() == 0

mocker.patch(
"grandchallenge.publications.utils.get_doi_csl", return_value=TEST_CSL
)

# only registered users can create a publication
response = get_view_for_user(
viewname="publications:create",
Expand Down

0 comments on commit 39f753f

Please sign in to comment.