Пример #1
0
 def test_call_bound_action_empty_result(self):
     with responses.RequestsMock() as rsps:
         rsps.add(
             rsps.POST,
             Product.__odata_url__() + '/ODataTest.DemoCollectionAction',
         )
         result = Product.DemoCollectionAction()
     self.assertIsNone(result)
Пример #2
0
 def test_call_bound_action_with_result(self):
     with responses.RequestsMock() as rsps:
         rsps.add(
             rsps.POST,
             Product.__odata_url__() + '/ODataTest.DemoCollectionAction',
             content_type='application/json',
             json=dict(value='test'),
         )
         result = Product.DemoCollectionAction()
     self.assertEqual(result, 'test')