Beispiel #1
0
  def test_passwordProperty(self):
    user = User()
    def t():
      user.password = 123

    self.assertRaises(TypeError, t)
    user.password = "******"
    self.assertTrue(checkPassword("123456", user.password))
    hsh = user.password.hash
    user.password = "******"
    self.assertNotEquals(hsh, user.password.hash)
Beispiel #2
0
  def test_passwordProperty(self):
    user = User()
    def t():
      user.password = 123

    self.assertRaises(TypeError, t)
    user.password = "******"
    self.assertTrue(checkPassword("123456", user.password))
    hsh = user.password.hash
    user.password = "******"
    self.assertNotEquals(hsh, user.password.hash)
Beispiel #3
0
  def test_load(self):
    user1 = User(username="******", password="******")
    user1.save()
    key = user1.key

    user1Copy = User.load(key)
    self.assertTrue(user1 is user1Copy)
    del user1
    del user1Copy
    user1 = User.load(key)
    self.assertEquals("foo_load", user1.username)
    self.assertTrue(checkPassword("123", user1.password))
    self.assertEquals(None, user1.email)
    user1.delete()
Beispiel #4
0
  def test_load(self):
    user1 = User(username="******", password="******")
    user1.save()
    key = user1.key

    user1Copy = User.load(key)
    self.assertTrue(user1 is user1Copy)
    del user1
    del user1Copy
    user1 = User.load(key)
    self.assertEquals("foo_load", user1.username)
    self.assertTrue(checkPassword("123", user1.password))
    self.assertEquals(None, user1.email)
    user1.delete()