From 7abdffae0df16131787b5407c15785568bced119 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 15 May 2022 02:48:59 +0200 Subject: [PATCH] Add post test --- InvenTree/plugin/base/integration/test_mixins.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/InvenTree/plugin/base/integration/test_mixins.py b/InvenTree/plugin/base/integration/test_mixins.py index 183735686f..4045d79b2d 100644 --- a/InvenTree/plugin/base/integration/test_mixins.py +++ b/InvenTree/plugin/base/integration/test_mixins.py @@ -218,6 +218,15 @@ class APICallMixinTest(BaseMixinDefinition, TestCase): result = self.mixin.api_call('https://reqres.in/api/users/2', endpoint_is_url=True) self.assertTrue(result) + # api_call with post and data + result = self.mixin.api_call( + 'api/users/', + data={"name": "morpheus", "job": "leader"}, + method='POST' + ) + self.assertTrue(result) + self.assertEqual(result['name'], 'morpheus') + def test_function_errors(self): """Test function errors""" # wrongly defined plugins should not load