def testPwdFail(self): r = Account.authenticate("*****@*****.**", "testpwd213213") self.assertEqual(r, {Account.FAIL: {Account.INVALID_PASSWORD:Account.errors[Account.INVALID_PASSWORD]}})
def testLoginSuccess(self): r = Account.authenticate("*****@*****.**", "testpwd") # Not too sure if they gives the same ID. auth = authenticate(username="******", password="******") # self.assertEqual(r, {0: [1]}) self.assertEqual(r.keys()[0], Account.SUCCESS)
def testEmailFail(self): # Check the authenticate. r = Account.authenticate("*****@*****.**", "testpwd") # How to get the user.id ? I'll check if success first. self.assertEqual(r, {Account.FAIL: {Account.INVALID_UNAME_EMAIL:Account.errors[Account.INVALID_UNAME_EMAIL]}})