mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-03 13:58:47 +00:00
Add post test
This commit is contained in:
parent
7c0dea69b0
commit
7abdffae0d
@ -218,6 +218,15 @@ class APICallMixinTest(BaseMixinDefinition, TestCase):
|
|||||||
result = self.mixin.api_call('https://reqres.in/api/users/2', endpoint_is_url=True)
|
result = self.mixin.api_call('https://reqres.in/api/users/2', endpoint_is_url=True)
|
||||||
self.assertTrue(result)
|
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):
|
def test_function_errors(self):
|
||||||
"""Test function errors"""
|
"""Test function errors"""
|
||||||
# wrongly defined plugins should not load
|
# wrongly defined plugins should not load
|
||||||
|
Loading…
x
Reference in New Issue
Block a user