Esempio n. 1
0
 def test_createDelete(self):
     testusername = "******" % (randint(100, 999))
     newuser = User.create(testusername, "xxx")
     self.assertIsNotNone(newuser)
     self.assertTrue(User.exists(testusername))
     newuser.delete()
     self.assertFalse(User.exists(testusername))
Esempio n. 2
0
 def createTestUser(self):
     if User.exists(self.username) is False:
         newuser = User.create(self.username, self.password)
Esempio n. 3
0
 def test_randomUserDoesntExists(self):
     randomname = "testrandom%s" % (randint(100, 999))
     exists = User.exists(randomname)
     self.assertFalse(exists)
Esempio n. 4
0
 def test_authenticateCorrect(self):
     self.createTestUser()
     self.assertTrue(User.exists(self.username))
     authuser = User.authenticate(self.username, self.password)
     self.assertEqual(self.username, authuser.username)
Esempio n. 5
0
 def test_adminUserExists(self):
     exists = User.exists("admin")
     self.assertTrue(exists)