Extract get_turtle_message().

This seems like kind of a silly function to extract
to topic.py, but it will theoretically help us sweep
"subject" if we change the DB.

It had test coverage.
This commit is contained in:
Steve Howell
2018-11-11 19:35:31 +00:00
committed by Tim Abbott
parent cc33e4cd0c
commit eb4d279bbc
3 changed files with 11 additions and 5 deletions

View File

@@ -227,3 +227,12 @@ def get_topic_history_for_web_public_stream(recipient: Recipient) -> List[Dict[s
cursor.close()
return generate_topic_history_from_db_rows(rows)
def get_turtle_message(message_ids: List[int]) -> Message:
# This is used for onboarding, and it's only extracted
# here to make subject -> topic sweeping easier.
turtle_message = Message.objects.get( # nolint
id__in=message_ids,
subject='topic demonstration',
content__icontains='cute/turtle.png')
return turtle_message