diff options
author | David Baker <dave@matrix.org> | 2015-03-24 18:21:54 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2015-03-24 18:21:54 +0000 |
commit | 438a21c87bec6386be1a9ed92d61b1b467a40bcd (patch) | |
tree | 9e7564b115955a707304186228d0126ee5cbad39 | |
parent | unused import (diff) | |
download | synapse-438a21c87bec6386be1a9ed92d61b1b467a40bcd.tar.xz |
Don't test exact equality of the list: as long as it has the fields we expect, that's just fine. I added the user_id (as in database pkey) and it broke: no point testing what that comes out as: it's determined by the db.
-rw-r--r-- | tests/storage/test_registration.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/storage/test_registration.py b/tests/storage/test_registration.py index e0b81f2b57..93be02f8c3 100644 --- a/tests/storage/test_registration.py +++ b/tests/storage/test_registration.py @@ -38,13 +38,12 @@ class RegistrationStoreTestCase(unittest.TestCase): @defer.inlineCallbacks def test_register(self): yield self.store.register(self.user_id, self.tokens[0], self.pwhash) + u = yield self.store.get_user_by_id(self.user_id)[0] - self.assertEquals( - # TODO(paul): Surely this field should be 'user_id', not 'name' - # Additionally surely it shouldn't come in a 1-element list - [{"name": self.user_id, "password_hash": self.pwhash}], - (yield self.store.get_user_by_id(self.user_id)) - ) + # TODO(paul): Surely this field should be 'user_id', not 'name' + # Additionally surely it shouldn't come in a 1-element list + self.assertEquals(self.user_id, u['name']) + self.assertEquals(self.pwhash, u['password_hash']) self.assertEquals( {"admin": 0, |