mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
The `expected` flag was incredibly confusing, as you couldn't tell from the calling code what you were actually expecting to happen. I avoid the context manager idiom in order to force the callers to create simple helper functions, and I de-duplicate some code in some places. I also force the caller to explicitly soft-deactivate the user with one simple line of code, so that the person reading the test doesn't have to research the side effects of the helper. (And I make it very easy for new authors to follow the practice going forward.) This is also somewhat of a prep commit to avoid the obfuscated use of refresh_from_db.
83 KiB
83 KiB