Example #1
0
    def test_call_bound_action_on_instance(self):
        test_product = Product()
        test_product.name = 'TestProduct'
        test_product.id = 1234
        test_product.price = decimal.Decimal('20.0')

        # shortcut for saving the entity
        test_product.__odata__.persisted = True

        with responses.RequestsMock() as rsps:
            rsps.add(
                rsps.POST,
                test_product.__odata__.instance_url + '/ODataTest.DemoAction',
            )
            result = test_product.DemoAction()
        self.assertIsNone(result)
Example #2
0
 def _call():
     Product.DemoAction()