summary refs log tree commit diff
path: root/tests/api/test_auth.py
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2016-07-20 17:38:45 +0100
committerGitHub <noreply@github.com>2016-07-20 17:38:45 +0100
commite9e3eaa67dd7a36e0328cc5c88808d9cc13c1b55 (patch)
tree5ea9e9ac753f7f6d0b2d7820b213cb8e7846c13a /tests/api/test_auth.py
parentDon't explode if we have no snapshots yet (diff)
parentRecord device_id in client_ips (diff)
downloadsynapse-e9e3eaa67dd7a36e0328cc5c88808d9cc13c1b55.tar.xz
Merge pull request #938 from matrix-org/rav/add_device_id_to_client_ips
Record device_id in client_ips
Diffstat (limited to 'tests/api/test_auth.py')
-rw-r--r--tests/api/test_auth.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/api/test_auth.py b/tests/api/test_auth.py
index 960c23d631..e91723ca3d 100644
--- a/tests/api/test_auth.py
+++ b/tests/api/test_auth.py
@@ -45,6 +45,7 @@ class AuthTestCase(unittest.TestCase):
         user_info = {
             "name": self.test_user,
             "token_id": "ditto",
+            "device_id": "device",
         }
         self.store.get_user_by_access_token = Mock(return_value=user_info)
 
@@ -143,7 +144,10 @@ class AuthTestCase(unittest.TestCase):
         # TODO(danielwh): Remove this mock when we remove the
         # get_user_by_access_token fallback.
         self.store.get_user_by_access_token = Mock(
-            return_value={"name": "@baldrick:matrix.org"}
+            return_value={
+                "name": "@baldrick:matrix.org",
+                "device_id": "device",
+            }
         )
 
         user_id = "@baldrick:matrix.org"
@@ -158,6 +162,10 @@ class AuthTestCase(unittest.TestCase):
         user = user_info["user"]
         self.assertEqual(UserID.from_string(user_id), user)
 
+        # TODO: device_id should come from the macaroon, but currently comes
+        # from the db.
+        self.assertEqual(user_info["device_id"], "device")
+
     @defer.inlineCallbacks
     def test_get_guest_user_from_macaroon(self):
         user_id = "@baldrick:matrix.org"