mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
split into more tests
This commit is contained in:
parent
3e6b37bf55
commit
442341de50
@ -178,7 +178,8 @@ class APICallMixinTest(BaseMixinDefinition, TestCase):
|
|||||||
API_URL_SETTING = 'test'
|
API_URL_SETTING = 'test'
|
||||||
self.mixin_wrong2 = WrongCLS2()
|
self.mixin_wrong2 = WrongCLS2()
|
||||||
|
|
||||||
def test_function(self):
|
def test_base_setup(self):
|
||||||
|
"""Test that the base settings work"""
|
||||||
# check init
|
# check init
|
||||||
self.assertTrue(self.mixin.has_api_call)
|
self.assertTrue(self.mixin.has_api_call)
|
||||||
# api_url
|
# api_url
|
||||||
@ -188,6 +189,8 @@ class APICallMixinTest(BaseMixinDefinition, TestCase):
|
|||||||
headers = self.mixin.api_headers
|
headers = self.mixin.api_headers
|
||||||
self.assertEqual(headers, {'Bearer': '', 'Content-Type': 'application/json'})
|
self.assertEqual(headers, {'Bearer': '', 'Content-Type': 'application/json'})
|
||||||
|
|
||||||
|
def test_args(self):
|
||||||
|
"""Test that building up args work"""
|
||||||
# api_build_url_args
|
# api_build_url_args
|
||||||
# 1 arg
|
# 1 arg
|
||||||
result = self.mixin.api_build_url_args({'a': 'b'})
|
result = self.mixin.api_build_url_args({'a': 'b'})
|
||||||
@ -199,6 +202,8 @@ class APICallMixinTest(BaseMixinDefinition, TestCase):
|
|||||||
result = self.mixin.api_build_url_args({'a': 'b', 'c': ['d', 'e', 'f', ]})
|
result = self.mixin.api_build_url_args({'a': 'b', 'c': ['d', 'e', 'f', ]})
|
||||||
self.assertEqual(result, '?a=b&c=d,e,f')
|
self.assertEqual(result, '?a=b&c=d,e,f')
|
||||||
|
|
||||||
|
def test_function(self):
|
||||||
|
"""Test that api calls work"""
|
||||||
# api_call
|
# api_call
|
||||||
result = self.mixin.get_external_url()
|
result = self.mixin.get_external_url()
|
||||||
self.assertTrue(result)
|
self.assertTrue(result)
|
||||||
|
Loading…
Reference in New Issue
Block a user