async def test_005_add( self ): total_count = MODEL_CLASS.count() post_data = await self.post_data_with_csrf() total_count+= 1 rsp= await self.client.post("/TABLE/add", data=post_data) self.assertEqual(rsp.status, 200) self.assertEqual(total_count, MODEL_CLASS.count())
async def test_006_delete( self ): csrf = await self.receive_csrf() model_id = self.collection[0].id total_count = MODEL_CLASS.count() rsp= await self.client.post("/TABLE/{}/delete".format(model_id), data={"csrftoken": csrf}) total_count-= 1 self.assertEqual(rsp.status, 200) self.assertEqual(total_count, MODEL_CLASS.count())