zulip/zerver/openapi
Steve Howell 2902f8b931 tests: Ensure stream senders get a UserMessage row.
We now complain if a test author sends a stream message
that does not result in the sender getting a
UserMessage row for the message.

This is basically 100% equivalent to complaining that
the author failed to subscribe the sender to the stream
as part of the test setup, as far as I can tell, so the
AssertionError instructs the author to subscribe the
sender to the stream.

We exempt bots from this check, although it is
plausible we should only exempt the system bots like
the notification bot.

I considered auto-subscribing the sender to the stream,
but that can be a little more expensive than the
current check, and we generally want test setup to be
explicit.

If there is some legitimate way than a subscribed human
sender can't get a UserMessage, then we probably want
an explicit test for that, or we may want to change the
backend to just write a UserMessage row in that
hypothetical situation.

For most tests, including almost all the ones fixed
here, the author just wants their test setup to
realistically reflect normal operation, and often devs
may not realize that Cordelia is not subscribed to
Denmark or not realize that Hamlet is not subscribed to
Scotland.

Some of us don't remember our Shakespeare from high
school, and our stream subscriptions don't even
necessarily reflect which countries the Bard placed his
characters in.

There may also be some legitimate use case where an
author wants to simulate sending a message to an
unsubscribed stream, but for those edge cases, they can
always set allow_unsubscribed_sender to True.
2021-12-10 09:40:04 -08:00
..
__init__.py openapi: Add missing __init__.py; fix type errors hidden by its absence. 2021-07-05 12:20:39 -07:00
curl_param_value_generators.py tests: Ensure stream senders get a UserMessage row. 2021-12-10 09:40:04 -08:00
javascript_examples.js eslint: Fix unicorn/no-new-array. 2021-01-25 14:53:19 -08:00
javascript_examples.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00
markdown_extension.py lint: Fix typos found by codespell. 2021-10-19 16:51:13 -07:00
openapi.py openapi: Remove unused to_python_type function. 2021-08-19 01:53:47 -07:00
python_examples.py openapi: Document remove-attachment endpoint. 2021-10-29 15:01:50 -07:00
test_curl_examples.py openapi: Use more carefully-constructed regexes for markdown extension. 2021-10-03 18:49:38 -07:00
testing.yaml openapi: Add missing object types. 2020-08-12 16:11:29 -07:00
zulip.yaml api docs: Clean up description of legacy reaction events. 2021-11-28 11:52:51 -08:00