Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

test_events: Run on_commit send_event hooks immediately.

Abhijeet Prasad Bodas51f5bbcd57da
diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py
index f6a1589ae4e..f3dc48535e4 100644
--- a/zerver/tests/test_events.py
+++ b/zerver/tests/test_events.py
@@ -276,7 +276,13 @@ class BaseAction(ZulipTestCase):
include_subscribers=include_subscribers,
include_streams=include_streams,
)
- action()
+
+ # We want even those `send_event` calls which have been hooked to
+ # `transaction.on_commit` to execute in tests.
+ # See the comment in `ZulipTestCase.tornado_redirected_to_list`.
+ with self.captureOnCommitCallbacks(execute=True):
+ action()
+
events = client.event_queue.contents()
content = {
"queue_id": "123.12",