Implement Manticore fully and re-theme
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import time
|
||||
from io import StringIO
|
||||
from unittest.mock import patch
|
||||
|
||||
from django.core.management import call_command
|
||||
from django.test import TestCase, override_settings
|
||||
@@ -105,6 +106,38 @@ class EventProjectionShadowTests(TestCase):
|
||||
1,
|
||||
)
|
||||
|
||||
@patch("core.events.projection.get_session_event_rows")
|
||||
def test_shadow_compare_can_project_from_manticore_rows(self, mocked_rows):
|
||||
message = Message.objects.create(
|
||||
user=self.user,
|
||||
session=self.session,
|
||||
ts=1700000000000,
|
||||
sender_uuid="+15555550333",
|
||||
text="hello",
|
||||
delivered_ts=1700000000000,
|
||||
read_ts=1700000000500,
|
||||
)
|
||||
mocked_rows.return_value = [
|
||||
{
|
||||
"ts": 1700000000000,
|
||||
"event_type": "message_created",
|
||||
"origin_transport": "signal",
|
||||
"origin_message_id": str(message.id),
|
||||
"payload": {"message_id": str(message.id), "text": "hello"},
|
||||
},
|
||||
{
|
||||
"ts": 1700000000500,
|
||||
"event_type": "read_receipt",
|
||||
"origin_transport": "signal",
|
||||
"origin_message_id": str(message.id),
|
||||
"payload": {"message_id": str(message.id), "read_ts": 1700000000500},
|
||||
},
|
||||
]
|
||||
|
||||
compared = shadow_compare_session(self.session, detail_limit=10)
|
||||
|
||||
self.assertEqual(0, compared["counters"]["missing_in_projection"])
|
||||
|
||||
def test_management_command_emits_summary(self):
|
||||
out = StringIO()
|
||||
call_command(
|
||||
|
||||
Reference in New Issue
Block a user