Causes any call to cursor to raise the upper most Error in djangos db Exception hierachy
()
| 210 | |
| 211 | @contextmanager |
| 212 | def simulate_postgres_error(): |
| 213 | """ |
| 214 | Causes any call to cursor to raise the upper most Error in djangos db |
| 215 | Exception hierachy |
| 216 | """ |
| 217 | with patch.object(connections[DEFAULT_DB_ALIAS], "cursor") as cursor_mock: |
| 218 | cursor_mock.side_effect = DjangoDatabaseError # This should be the most general |
| 219 | yield |
| 220 | |
| 221 | |
| 222 | @contextmanager |
no outgoing calls
no test coverage detected
searching dependent graphs…