mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
tests: Add a mocked session object for tornado tests.
(imported from commit 0431d4cbb2233b7136367ad33f04ed2cc219add2)
This commit is contained in:
@@ -400,6 +400,9 @@ class DummyHandler(object):
|
|||||||
def finish(self, _):
|
def finish(self, _):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
class DummySession(object):
|
||||||
|
session_key = "0"
|
||||||
|
|
||||||
class POSTRequestMock(object):
|
class POSTRequestMock(object):
|
||||||
method = "POST"
|
method = "POST"
|
||||||
|
|
||||||
@@ -407,6 +410,7 @@ class POSTRequestMock(object):
|
|||||||
self.POST = post_data
|
self.POST = post_data
|
||||||
self.user = user
|
self.user = user
|
||||||
self._tornado_handler = DummyHandler(assert_callback)
|
self._tornado_handler = DummyHandler(assert_callback)
|
||||||
|
self.session = DummySession()
|
||||||
|
|
||||||
class GetUpdatesTest(AuthedTestCase):
|
class GetUpdatesTest(AuthedTestCase):
|
||||||
fixtures = ['messages.json']
|
fixtures = ['messages.json']
|
||||||
|
|||||||
Reference in New Issue
Block a user