Skip to content

Commit c00dc44

Browse files
committed
Add missing context block
1 parent 7ba5f5e commit c00dc44

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

superdesk/tests/steps.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -501,12 +501,12 @@ async def delete_entries_for(context, resource: str) -> None:
501501
First tries with async, otherwise it falls back to sync resources.
502502
"""
503503

504-
async_app = context.app.async_app
505-
506-
try:
507-
await async_app.resources.get_resource_service(resource).delete_many({})
508-
except KeyError:
509-
get_resource_service(resource).delete_action()
504+
async with context.app.test_request_context(context.app.config["URL_PREFIX"]):
505+
try:
506+
async_app = context.app.async_app
507+
await async_app.resources.get_resource_service(resource).delete_many({})
508+
except KeyError:
509+
get_resource_service(resource).delete_action()
510510

511511

512512
@given('empty "{resource}"')

0 commit comments

Comments
 (0)