-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tests for background task behaviour in Wagtail 6.4 (#255)
In Wagtail 6.4 (wagtail/wagtail#12787), updating the search index and reference index after a database update are now handled as background tasks through the django-tasks library. In the default configuration, this happens at the end of the current transaction (if any), and since unit tests are typically wrapped in a transaction, we can no longer count on the results of database updates within tests being immediately visible in search and object usage queries. To ensure that these tasks are executed, we trigger the oncommit hooks via `self.captureOnCommitCallbacks(execute=True)`.
- Loading branch information
Showing
3 changed files
with
32 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters