Commit 5f90f71
committed
fix(test): wrap handler construction in RequestDTOFactory patch
ListRequestsHandler now eagerly instantiates RequestDTOFactory in
__init__ (factory hoist). The previous test patched the factory after
the handler was already constructed, so the patch had no effect and
the real factory accessed attributes the SimpleNamespace mock did
not define (e.g. last_status_check). Move the construction inside
the patch context and re-target the patch at the import site.1 parent db88b2f commit 5f90f71
1 file changed
Lines changed: 11 additions & 9 deletions
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
94 | 89 | | |
95 | 90 | | |
96 | 91 | | |
97 | 92 | | |
98 | 93 | | |
99 | 94 | | |
100 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
0 commit comments