summary refs log tree commit diff
path: root/tests/handlers/test_presencelike.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/handlers/test_presencelike.py')
-rw-r--r--tests/handlers/test_presencelike.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/handlers/test_presencelike.py b/tests/handlers/test_presencelike.py
index 2402bed8d5..38cc34350b 100644
--- a/tests/handlers/test_presencelike.py
+++ b/tests/handlers/test_presencelike.py
@@ -166,7 +166,11 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase):
         # TODO(paul): Gut-wrenching
         from synapse.handlers.presence import UserPresenceCache
         self.handlers.presence_handler._user_cachemap[self.u_apple] = (
-                UserPresenceCache())
+            UserPresenceCache()
+        )
+        self.handlers.presence_handler._user_cachemap[self.u_apple].update(
+            {"presence": OFFLINE}, serial=0
+        )
         apple_set = self.handlers.presence_handler._local_pushmap.setdefault(
                 "apple", set())
         apple_set.add(self.u_banana)
@@ -184,7 +188,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase):
             {"observed_user": self.u_banana,
                 "presence": ONLINE,
                 "state": ONLINE,
-                "mtime_age": 0,
+                "last_active_ago": 0,
                 "displayname": "Frank",
                 "avatar_url": "http://foo"},
             {"observed_user": self.u_clementine,
@@ -202,7 +206,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase):
         statuscache = self.mock_update_client.call_args[1]["statuscache"]
         self.assertEquals({
             "presence": ONLINE,
-            "mtime": 1000000, # MockClock
+            "last_active": 1000000, # MockClock
             "displayname": "Frank",
             "avatar_url": "http://foo",
         }, statuscache.state)
@@ -225,7 +229,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase):
         statuscache = self.mock_update_client.call_args[1]["statuscache"]
         self.assertEquals({
             "presence": ONLINE,
-            "mtime": 1000000, # MockClock
+            "last_active": 1000000, # MockClock
             "displayname": "I am an Apple",
             "avatar_url": "http://foo",
         }, statuscache.state)
@@ -243,7 +247,11 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase):
         # TODO(paul): Gut-wrenching
         from synapse.handlers.presence import UserPresenceCache
         self.handlers.presence_handler._user_cachemap[self.u_apple] = (
-                UserPresenceCache())
+            UserPresenceCache()
+        )
+        self.handlers.presence_handler._user_cachemap[self.u_apple].update(
+            {"presence": OFFLINE}, serial=0
+        )
         apple_set = self.handlers.presence_handler._remote_sendmap.setdefault(
                 "apple", set())
         apple_set.add(self.u_potato.domain)
@@ -259,7 +267,7 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase):
                         {"user_id": "@apple:test",
                          "presence": "online",
                          "state": "online",
-                         "mtime_age": 0,
+                         "last_active_ago": 0,
                          "displayname": "Frank",
                          "avatar_url": "http://foo"},
                     ],