moo.core.tests.test_security_queryset_wizard_guard
Security tests: queryset-level wizard guards.
Player, UniversalWizard, and the Preposition family have wizard-only save()/delete() overrides, but Django’s QuerySet.update()/delete() and bulk_create()/bulk_update() never call those methods. WizardGuardedManager closes that bypass; these tests pin the guard down.
Functions
|
Create a non-wizard Object to act as the restricted caller. |
Create a sacrificial Player row outside any caller context. |
|
|
|
Management commands and system code run with no caller; the guard must not fire. |
|
Regression: the one production queryset delete on Player still works. |
|
|