|
20 | 20 | from fattureincloud_python_sdk.models.payment_method_details import PaymentMethodDetails |
21 | 21 | from fattureincloud_python_sdk.models.payment_method_type import PaymentMethodType |
22 | 22 | from fattureincloud_python_sdk.models.vat_type import VatType |
| 23 | +from fattureincloud_python_sdk.models.get_tax_profile_response import GetTaxProfileResponse |
| 24 | +from fattureincloud_python_sdk.models.tax_profile import TaxProfile |
23 | 25 | from fattureincloud_python_sdk.models.create_payment_account_response import ( |
24 | 26 | CreatePaymentAccountResponse, |
25 | 27 | ) |
@@ -406,6 +408,57 @@ def test_modify_vat_type(self): |
406 | 408 | actual = self.api.modify_vat_type(2, 12345) |
407 | 409 | actual.data.id = 2 |
408 | 410 | assert actual == expected |
| 411 | + |
| 412 | + def test_get_tax_profile(self): |
| 413 | + resp = { |
| 414 | + "status": 200, |
| 415 | + "data": b'{"data": {"company_type": "individual","company_subtype": "artigiani","profession": "test","regime": "forfettario_5","rivalsa_name": "","default_rivalsa": 0,"cassa_name": "","default_cassa": 0,"default_cassa_taxable": 100,"cassa2_name": "","default_cassa2": 0,"default_cassa2_taxable": 0,"default_withholding_tax": 0,"default_withholding_tax_taxable": 100,"enasarco": false,"enasarco_type": "test","contributions_percentage": 0,"med": false,"default_vat": {"id": 66,"value": 0,"description": "Contribuenti forfettari","notes": "Operazione non soggetta a IVA ai sensi dell\'art. 1, commi 54-89, Legge n. 190\/2014 e succ. modifiche\/integrazioni","e_invoice": true,"ei_type": "2.2","ei_description": "Non soggetta art. 1\/54-89 L. 190\/2014 e succ. modifiche\/integrazioni","editable": false,"is_disabled": false,"default": true}}}', |
| 416 | + "reason": "OK", |
| 417 | + } |
| 418 | + |
| 419 | + mock_resp = RESTResponse(functions.Dict2Class(resp)) |
| 420 | + mock_resp.getheader = unittest.mock.MagicMock(return_value=None) |
| 421 | + mock_resp.getheaders = unittest.mock.MagicMock(return_value=None) |
| 422 | + |
| 423 | + self.api.api_client.rest_client.request = unittest.mock.MagicMock( |
| 424 | + return_value=mock_resp |
| 425 | + ) |
| 426 | + expected = GetTaxProfileResponse( |
| 427 | + data = TaxProfile( |
| 428 | + company_type="individual", |
| 429 | + company_subtype="artigiani", |
| 430 | + profession="test", |
| 431 | + regime="forfettario_5", |
| 432 | + rivalsa_name="", |
| 433 | + default_rivalsa=0, |
| 434 | + cassa_name="", |
| 435 | + default_cassa=0, |
| 436 | + default_cassa_taxable=100, |
| 437 | + cassa2_name="", |
| 438 | + default_cassa2=0, |
| 439 | + default_cassa2_taxable=0, |
| 440 | + default_withholding_tax=0, |
| 441 | + default_withholding_tax_taxable=100, |
| 442 | + enasarco=False, |
| 443 | + enasarco_type="test", |
| 444 | + contributions_percentage=0, |
| 445 | + med=False, |
| 446 | + default_vat={ |
| 447 | + "id": 66, |
| 448 | + "value": 0, |
| 449 | + "description": "Contribuenti forfettari", |
| 450 | + "notes": "Operazione non soggetta a IVA ai sensi dell'art. 1, commi 54-89, Legge n. 190/2014 e succ. modifiche/integrazioni", |
| 451 | + "e_invoice": True, |
| 452 | + "ei_type": "2.2", |
| 453 | + "ei_description": "Non soggetta art. 1/54-89 L. 190/2014 e succ. modifiche/integrazioni", |
| 454 | + "editable": False, |
| 455 | + "is_disabled": False, |
| 456 | + "default": True, |
| 457 | + } |
| 458 | + ) |
| 459 | + ) |
| 460 | + actual = self.api.get_tax_profile(2) |
| 461 | + assert actual == expected |
409 | 462 |
|
410 | 463 |
|
411 | 464 | if __name__ == "__main__": |
|
0 commit comments