def test_list(self): list_users = ListUsers() business.execute(list_users) self.assertListEqual([], list_users.result) renzo = User(name="Renzo") renzo.put() foo = User(name="foo") foo.put() business.execute(list_users) self.assertListEqual([renzo, foo], list_users.result)
def do_business(self): if self._future.get_result()>0: self.errors["name"]= "REPEATED_NAME" else: self.result=User(name=self.name)
def set_up(self): self._future=User.query().order(User.creation).fetch_async()
def set_up(self): self._future=User.query(User.name==self.name).count_async() self.result=None