Example #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))
Example #2
0
 def createTestUser(self):
     if User.exists(self.username) is False:
         newuser = User.create(self.username, self.password)
Example #3
0
 def test_randomUserDoesntExists(self):
     randomname = "testrandom%s" % (randint(100, 999))
     exists = User.exists(randomname)
     self.assertFalse(exists)
Example #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)
Example #5
0
 def test_adminUserExists(self):
     exists = User.exists("admin")
     self.assertTrue(exists)