示例#1
0
 def test_list_returns_empty_list(self):
     groupkey = ndb.Key('_', '_')
     self.assertEqual(Robot.list(ancestor=groupkey), [])
示例#2
0
 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])
示例#3
0
 def index(self):
     template_vars = {
         'robots': Robot.list(ancestor=self.current_user.key),
         'schedules': SCHEDULES
     }
     self.render_response('robot/index.html', **template_vars)