Commit 7776927
committed
Fix tests to account for search indexing happening as a background task
As of wagtail/wagtail#12787 in Wagtail 6.4, search indexing ordinarily happens at the end of the transaction where the objects are created/updated. Since tests are wrapped in transactions, we need to explicitly invoke the oncommit callbacks via `self.captureOnCommitCallbacks(execute=True)` to ensure that the changes we make to the database are reflected in search results.1 parent 4e472b9 commit 7776927
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
420 | 421 | | |
421 | 422 | | |
422 | 423 | | |
423 | | - | |
424 | | - | |
425 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
426 | 428 | | |
427 | 429 | | |
428 | 430 | | |
| |||
0 commit comments