Beispiel #1
0
 async def index(self):
     self.collection = MODEL_CLASS.all()
     return {
         "collection": self.collection,
         "fields": [MODEL_FIELD_NAMES],
         "controller": self
     }
Beispiel #2
0
 async def test_000_index( self ):
     rsp= await self.client.request("GET", "/TABLE")
     controller=self.app.last_controller
     self.assertEqual(rsp.status, 200)
     c_ids= list(map(lambda m: m.id, controller.collection))
     ids= list(map(lambda m: m.id, MODEL_CLASS.all()))
     self.assertEqual(ids, c_ids)
     self.assertEqual(len(c_ids), len(self.collection))