Make EventHandler.get_event return None when the requested event is not found (#15298)

This commit is contained in:
Andrew Morgan 2023-03-21 13:23:47 +00:00 committed by GitHub
parent f11fe931f5
commit b6aef59334
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View file

@ -84,6 +84,11 @@ class ReportEventTestCase(unittest.HomeserverTestCase):
access_token=self.other_user_tok,
)
self.assertEqual(404, channel.code, msg=channel.result["body"])
self.assertEqual(
"Unable to report event: it does not exist or you aren't able to see it.",
channel.json_body["error"],
msg=channel.result["body"],
)
def _assert_status(self, response_status: int, data: JsonDict) -> None:
channel = self.make_request(