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))
def main(): if db.exists() is True: p = db.path() print "" print "Database already exists: %s" % (p) print "" exit(1) print "" print "Creating database..." db.create() print "" username = "******" password = ''.join(random.choice(string.lowercase) for i in range(8)) newuser = User.create(username, password) print "New user '%s' created with password '%s'" % (username, password) return
def createTestUser(self): if User.exists(self.username) is False: newuser = User.create(self.username, self.password)