From d5014ab6acea33025a586d7bd0471a44d8f8d701 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 18 Jul 2022 00:35:23 +0200 Subject: [PATCH] Fix POST testing (#3346) * make call simpler * switch back to reqres.in for POST --- InvenTree/plugin/base/integration/test_mixins.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/InvenTree/plugin/base/integration/test_mixins.py b/InvenTree/plugin/base/integration/test_mixins.py index 13cfb47d79..3f95d56694 100644 --- a/InvenTree/plugin/base/integration/test_mixins.py +++ b/InvenTree/plugin/base/integration/test_mixins.py @@ -252,18 +252,19 @@ class APICallMixinTest(BaseMixinDefinition, TestCase): self.assertEqual(result.reason, 'OK') # api_call with full url - result = self.mixin.api_call('https://api.github.com/orgs/inventree', endpoint_is_url=True) + result = self.mixin.api_call('orgs/inventree') self.assertTrue(result) # api_call with post and data result = self.mixin.api_call( - 'repos/inventree/InvenTree', - method='GET' + 'https://reqres.in/api/users/', + data={"name": "morpheus", "job": "leader"}, + method='POST', + endpoint_is_url=True, ) self.assertTrue(result) - self.assertEqual(result['name'], 'InvenTree') - self.assertEqual(result['html_url'], 'https://github.com/inventree/InvenTree') + self.assertEqual(result['name'], 'morpheus') # api_call with filter result = self.mixin.api_call('repos/inventree/InvenTree/stargazers', url_args={'page': '2'})