def create(self, form): office = OfficeModel(form["city"], form["state"], form["seasonYear"], form["seasonMonth"], form["skypeChatId"], util.generateUUID(), True, datetime.now(), datetime.now()) db.session.add(office) db.session.commit() app.logger.info("Creating office=%s city=%s state=%s skypeChatId=%s", office.id, office.city, office.state, office.skypeChatId) return office
def test_generateUUID(self): uuid1 = util.generateUUID() uuid2 = util.generateUUID() assert uuid1 != None assert len(uuid1) == 36 assert uuid1 != uuid2
def test_scoreUnauthorized(self): for color in matchService.colors: rv = self.app.post("/api/buttons/{}/score".format(color), data = { "key": util.generateUUID() }) assert rv.status == self.unauthorized self.checkUnauthorizedResponse(rv.data)
def test_ismsUnauthorized(self): rv = self.app.get("/api/isms.json?key={}".format(util.generateUUID())) assert rv.status == self.unauthorized self.checkUnauthorizedResponse(rv.data)
def test_matchUnauthorized(self): with self.request: rv = self.app.get("/api/matches/{}.json?key={}".format(0, util.generateUUID())) assert rv.status == self.unauthorized self.checkUnauthorizedResponse(rv.data)
def test_scoreUnauthorized(self): for color in matchService.colors: rv = self.app.post("/api/buttons/{}/score".format(color), data={"key": util.generateUUID()}) assert rv.status == self.unauthorized self.checkUnauthorizedResponse(rv.data)
def test_matchUnauthorized(self): with self.request: rv = self.app.get("/api/matches/{}.json?key={}".format( 0, util.generateUUID())) assert rv.status == self.unauthorized self.checkUnauthorizedResponse(rv.data)