tests: Use assertion to enforce None-checks in tests.

This fixes a batch of mypy errors of the following format:
'Item "None" of "Optional[Something]" has no attribute "abc"

Since we have already been recklessly using these attritbutes
in the tests, adding assertions beforehand is justified presuming
that they oughtn't to be None.
This commit is contained in:
PIG208
2021-07-24 22:56:39 +08:00
committed by Tim Abbott
parent 442adfaff3
commit 495a8476be
21 changed files with 119 additions and 24 deletions

View File

@@ -509,6 +509,7 @@ class TestExport(ZulipTestCase):
content="Outbox emoji for export",
)
message = Message.objects.last()
assert message is not None
do_add_reaction(
self.example_user("iago"), message, "outbox", "1f4e4", Reaction.UNICODE_EMOJI
)