[SDESK-7442] Fix and improve tests #2153
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
To fix the tests that are related to
EventsAsyncService
.What has changed
clone_with
) inEventResourceModel
to facilitate the cloning and deep merging of a model instance and a given dict of updates (we can consider moving this base model later on if needed)EventsAsyncService
create
andupdate
methods to match the same functionality, as the legacy service usespatch
orpost
method to bypass the hooks. Instead, in the async service, I've abstracted the logic, which is bypassed in the legacy service, to explicitly use it so it is easier to follow and to understand.events_tests.py
to use newEventsAsyncService
async with self.app.app_context():
all over the testsWhat's pending
SDESK-7442
Thanks for checking!