mypy: Fix content types.

This got by mypy due to Message being an Any type.
This commit is contained in:
Steve Howell 2021-12-17 01:06:59 +00:00 committed by Steve Howell
parent 517ddbc9e6
commit 3138f7a73c
1 changed files with 3 additions and 3 deletions

View File

@ -1084,7 +1084,7 @@ class RealmImportExportTest(ExportFile):
# are replaced correctly with the values of newer realm.
@getter
def get_user_mention(r: Realm) -> Set[object]:
def get_user_mention(r: Realm) -> str:
mentioned_user = UserProfile.objects.get(
delivery_email=self.example_email("hamlet"), realm=r
)
@ -1093,14 +1093,14 @@ class RealmImportExportTest(ExportFile):
return mention_message.content
@getter
def get_stream_mention(r: Realm) -> Set[object]:
def get_stream_mention(r: Realm) -> str:
mentioned_stream = get_stream("Denmark", r)
data_stream_id = f'data-stream-id="{mentioned_stream.id}"'
mention_message = get_stream_messages(r).get(rendered_content__contains=data_stream_id)
return mention_message.content
@getter
def get_user_group_mention(r: Realm) -> Set[object]:
def get_user_group_mention(r: Realm) -> str:
user_group = UserGroup.objects.get(realm=r, name="hamletcharacters")
data_usergroup_id = f'data-user-group-id="{user_group.id}"'
mention_message = get_stream_messages(r).get(