Commit d0909ac0 by Raphael Lullis

Found out that User.signup was not actually returning a valid User instance…

Found out that User.signup was not actually returning a valid User instance (missing username). Fixed and improved test to catch the problem.
parent e7602e16
......@@ -362,6 +362,7 @@ class TestUser(unittest.TestCase):
self._destroy_user()
user = User.signup(self.username, self.password)
self.assert_(user is not None)
self.assert_(user.username == self.username)
def testCanLogin(self):
self._get_user() # User should be created here.
......
......@@ -64,7 +64,9 @@ class User(ParseResource):
@staticmethod
def signup(username, password, **kw):
return User(**User.POST('', username=username, password=password, **kw))
response_data = User.POST('', username=username, password=password, **kw)
response_data.update({'username': username})
return User(**response_data)
@staticmethod
def login(username, passwd):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment