Skip to content

Commit

Permalink
return json_response
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Oct 21, 2024
1 parent 93c9669 commit 2cfc860
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions services/web/server/tests/unit/isolated/test_security_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ async def _init(request: web.Request):
# get url and deliver product
product_name = expected_product_name
await _remember_product_name(request, product_name)
return web.HTTPOk()
return web.json_response(status=status.HTTP_200_OK)

@routes.post("/v0/hack/{product_name}")
async def _set_other_product(request: web.Request):
await _remember_product_name(request, request.match_info["product_name"])
return web.HTTPOk()
return web.json_response(status=status.HTTP_200_OK)

@routes.post("/v0/login")
async def _login(request: web.Request):
Expand All @@ -183,7 +183,7 @@ async def _login(request: web.Request):
@routes.post("/v0/public")
async def _public(request: web.Request):
assert await _get_product_name(request) == expected_product_name
return web.HTTPOk()
return web.json_response(status=status.HTTP_200_OK)

@routes.post("/v0/admin")
@login_required # NOTE: same as `await check_user_authorized(request)``
Expand All @@ -192,7 +192,7 @@ async def _public(request: web.Request):
)
async def _admin_only(request: web.Request):
assert await _get_product_name(request) == expected_product_name
return web.HTTPOk()
return web.json_response(status=status.HTTP_200_OK)

@routes.post("/v0/logout")
async def _logout(request: web.Request):
Expand Down

0 comments on commit 2cfc860

Please sign in to comment.