示例#1
0
 def testPwdFail(self):
     r = Account.authenticate("*****@*****.**", "testpwd213213")
     self.assertEqual(r, {Account.FAIL: {Account.INVALID_PASSWORD:Account.errors[Account.INVALID_PASSWORD]}})
示例#2
0
 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)
示例#3
0
 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]}})