1313""" # noqa: E501
1414
1515
16+ import json
1617import unittest
1718
1819from fattureincloud_python_sdk .models .entity_client_pre_create_info import (
1920 EntityClientPreCreateInfo ,
2021)
22+ from fattureincloud_python_sdk .models .payment_account import PaymentAccount
23+ from fattureincloud_python_sdk .models .payment_account_type import PaymentAccountType
24+ from fattureincloud_python_sdk .models .payment_method import PaymentMethod
25+ from fattureincloud_python_sdk .models .payment_method_type import PaymentMethodType
26+ from fattureincloud_python_sdk .models .price_list import PriceList
27+ from fattureincloud_python_sdk .models .vat_type import VatType
28+ from functions import json_serial
2129
2230
2331class TestEntityClientPreCreateInfo (unittest .TestCase ):
@@ -29,87 +37,58 @@ def setUp(self):
2937 def tearDown (self ):
3038 pass
3139
32- def make_instance (self , include_optional ) -> EntityClientPreCreateInfo :
33- """Test EntityClientPreCreateInfo
34- include_optional is a boolean, when False only required
35- params are included, when True both required and
36- optional params are included"""
37- # uncomment below to create an instance of `EntityClientPreCreateInfo`
38- """
39- model = EntityClientPreCreateInfo()
40- if include_optional:
41- return EntityClientPreCreateInfo(
42- countries_list = [
43- ''
44- ],
45- payment_methods_list = [
46- fattureincloud_python_sdk.models.payment_method.PaymentMethod(
47- id = 56,
48- name = '',
49- type = 'standard',
50- is_default = True,
51- default_payment_account = fattureincloud_python_sdk.models.payment_account.PaymentAccount(
52- id = 56,
53- name = 'Conto Banca Intesa',
54- iban = '',
55- sia = '',
56- cuc = '',
57- virtual = True, ),
58- details = [
59- fattureincloud_python_sdk.models.payment_method_details.PaymentMethodDetails(
60- title = '',
61- description = '', )
62- ],
63- bank_iban = '',
64- bank_name = '',
65- bank_beneficiary = '',
66- ei_payment_method = '', )
67- ],
68- payment_accounts_list = [
69- fattureincloud_python_sdk.models.payment_account.PaymentAccount(
70- id = 56,
71- name = 'Conto Banca Intesa',
72- type = 'standard',
73- iban = '',
74- sia = '',
75- cuc = '',
76- virtual = True, )
77- ],
78- vat_types_list = [
79- fattureincloud_python_sdk.models.vat_type.VatType(
80- id = 56,
81- value = 22,
82- description = 'Non imponibile art. 123',
83- notes = 'IVA non imponibile ai sensi dell'articolo 123, comma 2',
84- e_invoice = True,
85- ei_type = '2',
86- ei_description = '',
87- editable = True,
88- is_disabled = True,
89- default = True, )
90- ],
91- price_lists = [
92- fattureincloud_python_sdk.models.price_list.PriceList(
93- id = '',
94- name = '123',
95- prices_type = 'net',
96- is_default = True,
97- valid_from = '',
98- valid_to = '',
99- type = 'sell', )
100- ],
101- limit = 1.337,
102- usage = 1.337
103- )
104- else:
105- return EntityClientPreCreateInfo(
106- )
107- """
108-
10940 def testEntityClientPreCreateInfo (self ):
11041 """Test EntityClientPreCreateInfo"""
111- # inst_req_only = self.make_instance(include_optional=False)
112- # inst_req_and_optional = self.make_instance(include_optional=True)
42+ model = EntityClientPreCreateInfo (
43+ countries_list = [
44+ 'Italy'
45+ ],
46+ payment_methods_list = [
47+ PaymentMethod (
48+ id = 1 ,
49+ name = "name_example" ,
50+ type = PaymentMethodType ("standard" ),
51+ is_default = False ,
52+ )
53+ ],
54+ payment_accounts_list = [
55+ PaymentAccount (
56+ id = 1 ,
57+ name = "Conto Banca Intesa" ,
58+ type = PaymentAccountType ("standard" ),
59+ iban = "iban_example" ,
60+ sia = "sia_example" ,
61+ cuc = "cuc_example" ,
62+ virtual = True ,
63+ )
64+ ],
65+ vat_types_list = [
66+ VatType (
67+ id = 1 ,
68+ value = 22.0 ,
69+ description = "Non imponibile art. 123" ,
70+ notes = "IVA non imponibile ai sensi dell articolo 123, comma 2" ,
71+ e_invoice = True ,
72+ ei_type = "2" ,
73+ ei_description = "ei_description_example" ,
74+ is_disabled = True ,
75+ )
76+ ],
77+ price_lists = [
78+ PriceList (
79+ id = "12345" ,
80+ name = "Listino 1" ,
81+ prices_type = "net" ,
82+ is_default = True ,
83+ valid_from = "2021-01-01" ,
84+ valid_to = "2021-12-31" ,
85+ type = "sell" ,
86+ )
87+ ],
88+ )
89+ expected_json = '{"countries_list": ["Italy"], "payment_methods_list": [{"id": 1, "name": "name_example", "type": "standard", "is_default": false}], "payment_accounts_list": [{"id": 1, "name": "Conto Banca Intesa", "type": "standard", "iban": "iban_example", "sia": "sia_example", "cuc": "cuc_example", "virtual": true}], "vat_types_list": [{"id": 1, "value": 22.0, "description": "Non imponibile art. 123", "notes": "IVA non imponibile ai sensi dell articolo 123, comma 2", "e_invoice": true, "ei_type": "2", "ei_description": "ei_description_example", "is_disabled": true}], "price_lists": [{"id": "12345", "name": "Listino 1", "prices_type": "net", "is_default": true, "valid_from": "2021-01-01", "valid_to": "2021-12-31", "type": "sell"}]}'
90+ actual_json = json .dumps (model .to_dict (), default = json_serial )
91+ assert actual_json == expected_json
11392
11493
11594if __name__ == "__main__" :
0 commit comments