Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/service/publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from sqlalchemy.orm import aliased, joinedload, raiseload

from app.db.model import Person, Publication
from app.dependencies.auth import AdminContextDep
from app.dependencies.auth import AdminContextDep, UserContextDep
from app.dependencies.common import (
FacetsDep,
PaginationQuery,
Expand Down Expand Up @@ -62,7 +62,7 @@ def admin_read_one(db: SessionDep, id_: uuid.UUID) -> PublicationRead:
def create_one(
db: SessionDep,
json_model: PublicationCreate,
user_context: AdminContextDep,
user_context: UserContextDep, # See: https://github.com/openbraininstitute/obi-one/issues/867
) -> PublicationRead:
return router_create_one(
db=db,
Expand Down
9 changes: 7 additions & 2 deletions tests/test_publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ def model_id(publication):
return publication.id


def test_create_one(client_admin, json_data):
data = assert_request(client_admin.post, url=ROUTE, json=json_data).json()
def test_create_one_admin(clients, json_data):
data = assert_request(clients.admin.post, url=ROUTE, json=json_data).json()
_assert_read_response(data, json_data)


def test_create_one_user(clients, json_data):
data = assert_request(clients.user_1.post, url=ROUTE, json=json_data).json()
_assert_read_response(data, json_data)


Expand Down