def test_list_returns_empty_list(self): groupkey = ndb.Key('_', '_') self.assertEqual(Robot.list(ancestor=groupkey), [])
def test_list_returns_one(self): groupkey = ndb.Key('_', '_') robot = Robot(parent=groupkey, name='_', schedule=SCHEDULES.keys()[0]) robot.put() self.assertEqual(Robot.list(ancestor=groupkey), [robot])
def index(self): template_vars = { 'robots': Robot.list(ancestor=self.current_user.key), 'schedules': SCHEDULES } self.render_response('robot/index.html', **template_vars)