test_helpers: Move get_subscription out of actions.py.

It's no longer used by anything other than test code.
This commit is contained in:
Tim Abbott
2017-01-29 19:31:24 -08:00
parent 035e442b63
commit 01daa3e91a
4 changed files with 11 additions and 11 deletions

View File

@@ -30,6 +30,7 @@ from zerver.lib.actions import (
)
from zerver.models import (
get_recipient,
get_stream,
get_user_profile_by_email,
Client,
@@ -206,6 +207,13 @@ def most_recent_message(user_profile):
usermessage = most_recent_usermessage(user_profile)
return usermessage.message
def get_subscription(stream_name, user_profile):
# type: (Text, UserProfile) -> Subscription
stream = get_stream(stream_name, user_profile.realm)
recipient = get_recipient(Recipient.STREAM, stream.id)
return Subscription.objects.get(user_profile=user_profile,
recipient=recipient, active=True)
def get_user_messages(user_profile):
# type: (UserProfile) -> List[Message]
query = UserMessage.objects. \