@@ -45,7 +45,7 @@ class APIV1CreateTestCase(BaseAPIV1TestCase):
|
||||
self.assertIsNotNone(content.get("id", None), msg=response.content)
|
||||
|
||||
def test_create_intervention(self):
|
||||
""" Tests api creation of bare minimum interventions
|
||||
""" Tests api creation
|
||||
|
||||
Returns:
|
||||
|
||||
@@ -57,7 +57,7 @@ class APIV1CreateTestCase(BaseAPIV1TestCase):
|
||||
self._test_create_object(url, post_body)
|
||||
|
||||
def test_create_compensation(self):
|
||||
""" Tests api creation of bare minimum interventions
|
||||
""" Tests api creation
|
||||
|
||||
Returns:
|
||||
|
||||
@@ -80,7 +80,7 @@ class APIV1CreateTestCase(BaseAPIV1TestCase):
|
||||
self._test_create_object(url, post_body)
|
||||
|
||||
def test_create_eco_account(self):
|
||||
""" Tests api creation of bare minimum interventions
|
||||
""" Tests api creation
|
||||
|
||||
Returns:
|
||||
|
||||
@@ -92,7 +92,7 @@ class APIV1CreateTestCase(BaseAPIV1TestCase):
|
||||
self._test_create_object(url, post_body)
|
||||
|
||||
def test_create_ema(self):
|
||||
""" Tests api creation of bare minimum interventions
|
||||
""" Tests api creation
|
||||
|
||||
Returns:
|
||||
|
||||
@@ -103,3 +103,20 @@ class APIV1CreateTestCase(BaseAPIV1TestCase):
|
||||
post_body = json.load(fp=json_file)
|
||||
self._test_create_object(url, post_body)
|
||||
|
||||
def test_create_deduction(self):
|
||||
""" Tests api creation
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
self.intervention.share_with(self.superuser)
|
||||
self.eco_account.share_with(self.superuser)
|
||||
|
||||
url = reverse("api:v1:deduction")
|
||||
json_file_path = "api/tests/v1/create/deduction_create_post_body.json"
|
||||
with open(json_file_path) as json_file:
|
||||
post_body = json.load(fp=json_file)
|
||||
post_body["intervention"] = str(self.intervention.id)
|
||||
post_body["eco_account"] = str(self.eco_account.id)
|
||||
self._test_create_object(url, post_body)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user