Commit 5380a64
test: cover every #641 acceptance criterion and the deletion edge cases
Add a test per acceptance criterion, plus the cases the previous per-foreign-key
shape could not reach: a taxonomy or course run deleted with a scoped rule
profile, two taxonomies deleted together, an archived profile's scope being
reused, and an ObjectTag delete leaving a childless group behind.
Add test_criteria_trees.py for whole-tree deletion, so a test proves the bad
outcome is avoided rather than only that a cascade fired: it builds a
root/branch/grandchild tree with criteria at two levels and a mix of
profile-assigned and override criteria, deletes in the middle, and asserts
exactly which rows survive.
Run the deletion paths under MySQL's collector semantics while still on SQLite,
by setting can_defer_constraint_checks to False. That is what makes this class
of bug visible in the fast local suite instead of only in the MySQL CI job.
Rename every test so the name states the expected behavior rather than the
mechanism, and move the fixtures duplicated across both files into conftest.py.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 091724e commit 5380a64
4 files changed
Lines changed: 1002 additions & 260 deletions
File tree
- tests/openedx_learning/applets/cbe
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
0 commit comments