def add(uid, name, logo=None): "TODO: normalize uid to lower case" if get_by_id(uid) != None: raise RestaurantExistError("uid = %s" % uid) restaurant = Restaurant(id=uid, uid=uid, name=name, logo=logo) restaurant.put() return restaurant
def testInsertEntity(self): restaurant = Restaurant() restaurant.put() self.assertEqual(1, len(Restaurant.query().fetch(2)))