Commit 7473c84
Control after-commit calls in tests with a setting
By default, in (non transaction testcase) tests, we simulate the
execution of after-commit callbacks, to reproduce Django's normal
behaviour when outside of tests.
To allow projects to migrate their existing code over to this new
paradigm gradually, we allow this behaviour to be disabled. This was
previously controlled by monkey-patching a module scoped value in tests,
but is now exposed with a Django setting:
`SUBATOMIC_RUN_AFTER_COMMIT_CALLBACKS_IN_TESTS`.
Co-authored-by: Samuel Searles-Bryant <sam.searles-bryant@kraken.tech>1 parent 93c4785 commit 7473c84
3 files changed
+21
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 48 | | |
53 | 49 | | |
54 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
| |||
224 | 220 | | |
225 | 221 | | |
226 | 222 | | |
227 | | - | |
| 223 | + | |
| 224 | + | |
228 | 225 | | |
229 | 226 | | |
230 | 227 | | |
| |||
335 | 332 | | |
336 | 333 | | |
337 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
372 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
373 | 376 | | |
374 | 377 | | |
375 | 378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 62 | | |
86 | 63 | | |
87 | 64 | | |
| |||
463 | 440 | | |
464 | 441 | | |
465 | 442 | | |
466 | | - | |
467 | | - | |
| 443 | + | |
468 | 444 | | |
469 | 445 | | |
470 | 446 | | |
471 | 447 | | |
472 | 448 | | |
473 | | - | |
| 449 | + | |
474 | 450 | | |
475 | 451 | | |
476 | 452 | | |
477 | 453 | | |
478 | 454 | | |
479 | 455 | | |
480 | | - | |
| 456 | + | |
| 457 | + | |
481 | 458 | | |
482 | 459 | | |
483 | 460 | | |
484 | | - | |
485 | 461 | | |
486 | 462 | | |
487 | 463 | | |
| |||
493 | 469 | | |
494 | 470 | | |
495 | 471 | | |
496 | | - | |
| 472 | + | |
497 | 473 | | |
498 | 474 | | |
499 | 475 | | |
500 | | - | |
501 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
502 | 479 | | |
503 | | - | |
| 480 | + | |
504 | 481 | | |
505 | | - | |
| 482 | + | |
506 | 483 | | |
507 | 484 | | |
508 | 485 | | |
| |||
0 commit comments