summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorblide <cool.shahov@yandex.ru>2016-03-10 02:08:37 +0300
committerblide <cool.shahov@yandex.ru>2016-03-10 10:29:19 +0300
commit40160e24ab93ca4261df82335ab5521f134e2eda (patch)
tree2550d435d957ed2faefcff2836dcb0bf352356bd /tests
parentMerge pull request #634 from matrix-org/erikj/pin_saml2_version (diff)
downloadsynapse-40160e24ab93ca4261df82335ab5521f134e2eda.tar.xz
Register endpoint returns refresh_token
Guest registration still doesn't return refresh_token
Diffstat (limited to 'tests')
-rw-r--r--tests/rest/client/v2_alpha/test_register.py30
1 files changed, 18 insertions, 12 deletions
diff --git a/tests/rest/client/v2_alpha/test_register.py b/tests/rest/client/v2_alpha/test_register.py
index b867599079..e19952b8b6 100644
--- a/tests/rest/client/v2_alpha/test_register.py
+++ b/tests/rest/client/v2_alpha/test_register.py
@@ -62,12 +62,15 @@ class RegisterRestServletTestCase(unittest.TestCase):
         self.registration_handler.appservice_register = Mock(
             return_value=(user_id, token)
         )
-        result = yield self.servlet.on_POST(self.request)
-        self.assertEquals(result, (200, {
-            "user_id": user_id,
-            "access_token": token,
-            "home_server": self.hs.hostname
-        }))
+        (code, result) = yield self.servlet.on_POST(self.request)
+        self.assertEquals(code, 200)
+        det_data = {
+             "user_id": user_id,
+             "access_token": token,
+             "home_server": self.hs.hostname
+        }
+        self.assertDictContainsSubset(det_data, result)
+        self.assertIn("refresh_token", result)
 
     @defer.inlineCallbacks
     def test_POST_appservice_registration_invalid(self):
@@ -112,12 +115,15 @@ class RegisterRestServletTestCase(unittest.TestCase):
         })
         self.registration_handler.register = Mock(return_value=(user_id, token))
 
-        result = yield self.servlet.on_POST(self.request)
-        self.assertEquals(result, (200, {
-            "user_id": user_id,
-            "access_token": token,
-            "home_server": self.hs.hostname
-        }))
+        (code, result) = yield self.servlet.on_POST(self.request)
+        self.assertEquals(code, 200)
+        det_data = {
+             "user_id": user_id,
+             "access_token": token,
+             "home_server": self.hs.hostname
+        }
+        self.assertDictContainsSubset(det_data, result)
+        self.assertIn("refresh_token", result)
 
     def test_POST_disabled_registration(self):
         self.hs.config.enable_registration = False