mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
context_processors.py: Add flag for whether user is logged in.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user