Beispiel #1
0
 def get_fetch_payload(msg_id: int, apply_markdown: bool,
                       client_gravatar: bool) -> Dict[str, Any]:
     msg = reload_message(msg_id)
     unhydrated_dict = MessageDict.to_dict_uncached_helper([msg])[0]
     # The next step mutates the dict in place
     # for performance reasons.
     MessageDict.post_process_dicts(
         [unhydrated_dict],
         apply_markdown=apply_markdown,
         client_gravatar=client_gravatar,
     )
     final_dict = unhydrated_dict
     return final_dict
Beispiel #2
0
 def assert_topic_links(links: List[str], msg: Message) -> None:
     dct = MessageDict.to_dict_uncached_helper([msg])[0]
     self.assertEqual(dct[TOPIC_LINKS], links)