context_processors.py: Add flag for whether user is logged in.

This commit is contained in:
Jack Zhang
2017-08-03 18:59:52 -07:00
committed by Tim Abbott
parent 182570d5f3
commit a533ab5881
2 changed files with 8 additions and 2 deletions

View File

@@ -277,13 +277,14 @@ class HostRequestMock(object):
"""A mock request object where get_host() works. Useful for testing
routes that use Zulip's subdomains feature"""
def __init__(self, host=settings.EXTERNAL_HOST):
# type: (Text) -> None
def __init__(self, user_profile=None, host=settings.EXTERNAL_HOST):
# type: (UserProfile, Text) -> None
self.host = host
self.GET = {} # type: Dict[str, Any]
self.POST = {} # type: Dict[str, Any]
self.META = {'PATH_INFO': 'test'}
self.path = ''
self.user = user_profile
def get_host(self):
# type: () -> Text