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 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)
示例#3
0
 def do_business(self):
     if self._future.get_result()>0:
         self.errors["name"]= "REPEATED_NAME"
     else:
         self.result=User(name=self.name)
示例#4
0
 def set_up(self):
     self._future=User.query().order(User.creation).fetch_async()
示例#5
0
 def set_up(self):
     self._future=User.query(User.name==self.name).count_async()
     self.result=None