summary refs log tree commit diff
path: root/tests/rest
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-18 13:05:07 +0100
committerErik Johnston <erik@matrix.org>2014-09-18 13:05:07 +0100
commit704e7e9f44bb6ac4de03e47fd9276396d3c00af9 (patch)
tree2b3f49347cb9615bdacf276a8b786243aa16d324 /tests/rest
parentfreenode verification (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into release-v0.3.0 (diff)
downloadsynapse-704e7e9f44bb6ac4de03e47fd9276396d3c00af9.tar.xz
Merge branch 'release-v0.3.0' of github.com:matrix-org/synapse v0.3.0
Diffstat (limited to 'tests/rest')
-rw-r--r--tests/rest/test_events.py4
-rw-r--r--tests/rest/test_presence.py6
-rw-r--r--tests/rest/test_profile.py3
-rw-r--r--tests/rest/utils.py12
4 files changed, 13 insertions, 12 deletions
diff --git a/tests/rest/test_events.py b/tests/rest/test_events.py
index fd2224f55f..79b371c04d 100644
--- a/tests/rest/test_events.py
+++ b/tests/rest/test_events.py
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 """ Tests REST events for /events paths."""
-from twisted.trial import unittest
+from tests import unittest
 
 # twisted imports
 from twisted.internet import defer
@@ -27,14 +27,12 @@ from synapse.server import HomeServer
 
 # python imports
 import json
-import logging
 
 from ..utils import MockHttpResource, MemoryDataStore
 from .utils import RestTestCase
 
 from mock import Mock, NonCallableMock
 
-logging.getLogger().addHandler(logging.NullHandler())
 
 PATH_PREFIX = "/_matrix/client/api/v1"
 
diff --git a/tests/rest/test_presence.py b/tests/rest/test_presence.py
index a1db0fbcf3..ea3478ac5d 100644
--- a/tests/rest/test_presence.py
+++ b/tests/rest/test_presence.py
@@ -15,11 +15,10 @@
 
 """Tests REST events for /presence paths."""
 
-from twisted.trial import unittest
+from tests import unittest
 from twisted.internet import defer
 
 from mock import Mock
-import logging
 
 from ..utils import MockHttpResource
 
@@ -28,9 +27,6 @@ from synapse.handlers.presence import PresenceHandler
 from synapse.server import HomeServer
 
 
-logging.getLogger().addHandler(logging.NullHandler())
-
-
 OFFLINE = PresenceState.OFFLINE
 UNAVAILABLE = PresenceState.UNAVAILABLE
 ONLINE = PresenceState.ONLINE
diff --git a/tests/rest/test_profile.py b/tests/rest/test_profile.py
index f41810df1f..e6e51f6dd0 100644
--- a/tests/rest/test_profile.py
+++ b/tests/rest/test_profile.py
@@ -15,7 +15,7 @@
 
 """Tests REST events for /profile paths."""
 
-from twisted.trial import unittest
+from tests import unittest
 from twisted.internet import defer
 
 from mock import Mock
@@ -28,6 +28,7 @@ from synapse.server import HomeServer
 myid = "@1234ABCD:test"
 PATH_PREFIX = "/_matrix/client/api/v1"
 
+
 class ProfileTestCase(unittest.TestCase):
     """ Tests profile management. """
 
diff --git a/tests/rest/utils.py b/tests/rest/utils.py
index 77f5ecf0df..579441fb4a 100644
--- a/tests/rest/utils.py
+++ b/tests/rest/utils.py
@@ -17,7 +17,7 @@
 from twisted.internet import defer
 
 # trial imports
-from twisted.trial import unittest
+from tests import unittest
 
 from synapse.api.constants import Membership
 
@@ -95,8 +95,14 @@ class RestTestCase(unittest.TestCase):
 
     @defer.inlineCallbacks
     def register(self, user_id):
-        (code, response) = yield self.mock_resource.trigger("POST", "/register",
-                                '{"user_id":"%s"}' % user_id)
+        (code, response) = yield self.mock_resource.trigger(
+            "POST",
+            "/register",
+            json.dumps({
+                "user": user_id,
+                "password": "test",
+                "type": "m.login.password"
+            }))
         self.assertEquals(200, code)
         defer.returnValue(response)