Commit a553e89
committed
test(orphans): make confirm-endpoint test robust to settings-reference pollution
test_only_current_orphan_candidates_accepted passed in isolation but failed in
the full suite: admin_router and endpoint_util bind 'settings' by reference at
import, and in the full suite they were first-imported while another test had
opi.core.config.settings replaced (mock_settings fixture) or reloaded
(test_secret_key_failclosed). That left their module-level reference pointing at
a stale mock, surfacing as a 501 (ADMIN_API_KEY unset) and then a MagicMock in
the JSON response (DELETION_GRACE_PERIOD_DAYS). Re-point both module references
to the live settings before patching the attributes the endpoint reads.1 parent 23dfc87 commit a553e89
1 file changed
Lines changed: 15 additions & 3 deletions
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
190 | 191 | | |
| 192 | + | |
191 | 193 | | |
192 | | - | |
193 | 194 | | |
194 | | - | |
195 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
196 | 208 | | |
197 | 209 | | |
198 | 210 | | |
| |||
0 commit comments