style(test_form.py): Formateo PEP8 se agrega withholding
This commit is contained in:
		| @@ -29,8 +29,9 @@ def test_invoice_legalmonetary(): | |||||||
|             subtotals=[ |             subtotals=[ | ||||||
|                 form.TaxSubTotal( |                 form.TaxSubTotal( | ||||||
|                     percent=19.0, |                     percent=19.0, | ||||||
|                 )] |                 )]), | ||||||
|         ) |         withholding=form.WithholdingTaxTotal( | ||||||
|  |             subtotals=[]) | ||||||
|     )) |     )) | ||||||
|  |  | ||||||
|     inv.calculate() |     inv.calculate() | ||||||
| @@ -46,7 +47,8 @@ def test_invoice_legalmonetary(): | |||||||
|  |  | ||||||
| def test_allowancecharge_as_discount(): | def test_allowancecharge_as_discount(): | ||||||
|     discount = form.AllowanceChargeAsDiscount(amount=form.Amount(1000.0)) |     discount = form.AllowanceChargeAsDiscount(amount=form.Amount(1000.0)) | ||||||
|     assert discount.isDiscount() == True |  | ||||||
|  |     assert discount.isDiscount() | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_FAU10(): | def test_FAU10(): | ||||||
| @@ -63,18 +65,22 @@ def test_FAU10(): | |||||||
|         tax=form.TaxTotal( |         tax=form.TaxTotal( | ||||||
|             subtotals=[ |             subtotals=[ | ||||||
|                 form.TaxSubTotal( |                 form.TaxSubTotal( | ||||||
|                     percent = 19.0, |                     percent=19.0)]), | ||||||
|                 ) |         withholding=form.WithholdingTaxTotal( | ||||||
|             ] |             subtotals=[]) | ||||||
|         ) |  | ||||||
|     )) |     )) | ||||||
|  |  | ||||||
|     inv.add_allowance_charge(form.AllowanceCharge(amount=form.Amount(19.0))) |     inv.add_allowance_charge(form.AllowanceCharge(amount=form.Amount(19.0))) | ||||||
|  |  | ||||||
|     inv.calculate() |     inv.calculate() | ||||||
|     assert inv.invoice_legal_monetary_total.line_extension_amount == form.Amount(100.0) |     assert inv.invoice_legal_monetary_total.line_extension_amount == ( | ||||||
|     assert inv.invoice_legal_monetary_total.tax_exclusive_amount == form.Amount(100.0) |         form.Amount(100.0)) | ||||||
|     assert inv.invoice_legal_monetary_total.tax_inclusive_amount == form.Amount(119.0) |     assert inv.invoice_legal_monetary_total.tax_exclusive_amount == ( | ||||||
|     assert inv.invoice_legal_monetary_total.charge_total_amount == form.Amount(19.0) |         form.Amount(100.0)) | ||||||
|  |     assert inv.invoice_legal_monetary_total.tax_inclusive_amount == ( | ||||||
|  |         form.Amount(119.0)) | ||||||
|  |     assert inv.invoice_legal_monetary_total.charge_total_amount == ( | ||||||
|  |         form.Amount(19.0)) | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_FAU14(): | def test_FAU14(): | ||||||
| @@ -92,12 +98,14 @@ def test_FAU14(): | |||||||
|             subtotals=[ |             subtotals=[ | ||||||
|                 form.TaxSubTotal( |                 form.TaxSubTotal( | ||||||
|                     percent=19.0, |                     percent=19.0, | ||||||
|                 ) |                 )]), | ||||||
|             ] |         withholding=form.WithholdingTaxTotal( | ||||||
|         ) |             subtotals=[]) | ||||||
|     )) |     )) | ||||||
|     inv.add_allowance_charge(form.AllowanceCharge(amount=form.Amount(19.0))) |     inv.add_allowance_charge(form.AllowanceCharge( | ||||||
|     inv.add_prepaid_payment(form.PrePaidPayment(paid_amount = form.Amount(50.0))) |         amount=form.Amount(19.0))) | ||||||
|  |     inv.add_prepaid_payment(form.PrePaidPayment( | ||||||
|  |         paid_amount=form.Amount(50.0))) | ||||||
|     inv.calculate() |     inv.calculate() | ||||||
|  |  | ||||||
|     wants = form.Amount(119.0 + 19.0 - 50.0) |     wants = form.Amount(119.0 + 19.0 - 50.0) | ||||||
| @@ -115,6 +123,7 @@ def test_invalid_tipo_operacion_nota_debito(): | |||||||
|     with pytest.raises(ValueError): |     with pytest.raises(ValueError): | ||||||
|         inv.set_operation_type(22) |         inv.set_operation_type(22) | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_valid_tipo_operacion_nota_debito(): | def test_valid_tipo_operacion_nota_debito(): | ||||||
|     reference = form.InvoiceDocumentReference( |     reference = form.InvoiceDocumentReference( | ||||||
|         ident='11111', |         ident='11111', | ||||||
| @@ -124,16 +133,19 @@ def test_valid_tipo_operacion_nota_debito(): | |||||||
|     inv = form.DebitNote(reference) |     inv = form.DebitNote(reference) | ||||||
|     inv.set_operation_type('30') |     inv.set_operation_type('30') | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_invalid_tipo_operacion_nota_credito(): | def test_invalid_tipo_operacion_nota_credito(): | ||||||
|     reference = form.InvoiceDocumentReference( |     reference = form.InvoiceDocumentReference( | ||||||
|         ident='11111', |         ident='11111', | ||||||
|         uuid='21312312', |         uuid='21312312', | ||||||
|         date='2020-05-05' |         date='2020-05-05' | ||||||
|     ) |     ) | ||||||
|  |  | ||||||
|     inv = form.DebitNote(reference) |     inv = form.DebitNote(reference) | ||||||
|     with pytest.raises(ValueError): |     with pytest.raises(ValueError): | ||||||
|         inv.set_operation_type('990') |         inv.set_operation_type('990') | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_valid_tipo_operacion_nota_credito(): | def test_valid_tipo_operacion_nota_credito(): | ||||||
|     reference = form.InvoiceDocumentReference( |     reference = form.InvoiceDocumentReference( | ||||||
|         ident='11111', |         ident='11111', | ||||||
| @@ -148,6 +160,7 @@ def test_quantity(): | |||||||
|     quantity1 = form.Quantity(10, '94') |     quantity1 = form.Quantity(10, '94') | ||||||
|     assert quantity1 * form.Amount(3) == form.Amount(30) |     assert quantity1 * form.Amount(3) == form.Amount(30) | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_invoice_line_quantity_without_taxes(): | def test_invoice_line_quantity_without_taxes(): | ||||||
|     line = form.InvoiceLine( |     line = form.InvoiceLine( | ||||||
|         quantity=form.Quantity(10, '94'), |         quantity=form.Quantity(10, '94'), | ||||||
| @@ -156,13 +169,16 @@ def test_invoice_line_quantity_without_taxes(): | |||||||
|         price=form.Price( |         price=form.Price( | ||||||
|             amount=form.Amount(30.00), |             amount=form.Amount(30.00), | ||||||
|             type_code='01', |             type_code='01', | ||||||
|             type = 'x' |             type='x'), | ||||||
|         ), |         tax=form.TaxTotal(subtotals=[]), | ||||||
|         tax = form.TaxTotal(subtotals=[])) |         withholding=form.WithholdingTaxTotal( | ||||||
|  |             subtotals=[]) | ||||||
|  |     ) | ||||||
|     line.calculate() |     line.calculate() | ||||||
|     assert line.total_amount == form.Amount(300) |     assert line.total_amount == form.Amount(300) | ||||||
|     assert line.tax_amount == form.Amount(0) |     assert line.tax_amount == form.Amount(0) | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_invoice_legalmonetary_with_taxes(): | def test_invoice_legalmonetary_with_taxes(): | ||||||
|     inv = form.NationalSalesInvoice() |     inv = form.NationalSalesInvoice() | ||||||
|     inv.add_invoice_line(form.InvoiceLine( |     inv.add_invoice_line(form.InvoiceLine( | ||||||
| @@ -174,15 +190,22 @@ def test_invoice_legalmonetary_with_taxes(): | |||||||
|             type_code='01', |             type_code='01', | ||||||
|             type='x' |             type='x' | ||||||
|         ), |         ), | ||||||
|         tax = form.TaxTotal(subtotals=[]) |         tax=form.TaxTotal(subtotals=[]), | ||||||
|  |         withholding=form.WithholdingTaxTotal( | ||||||
|  |             subtotals=[]) | ||||||
|     )) |     )) | ||||||
|     inv.calculate() |     inv.calculate() | ||||||
|  |  | ||||||
|     assert inv.invoice_legal_monetary_total.line_extension_amount == form.Amount(100.0) |     assert inv.invoice_legal_monetary_total.line_extension_amount == ( | ||||||
|     assert inv.invoice_legal_monetary_total.tax_exclusive_amount == form.Amount(100.0) |         form.Amount(100.0)) | ||||||
|     assert inv.invoice_legal_monetary_total.tax_inclusive_amount == form.Amount(100.0) |     assert inv.invoice_legal_monetary_total.tax_exclusive_amount == ( | ||||||
|     assert inv.invoice_legal_monetary_total.charge_total_amount == form.Amount(0.0) |         form.Amount(100.0)) | ||||||
|     assert inv.invoice_legal_monetary_total.payable_amount == form.Amount(100.0) |     assert inv.invoice_legal_monetary_total.tax_inclusive_amount == ( | ||||||
|  |         form.Amount(100.0)) | ||||||
|  |     assert inv.invoice_legal_monetary_total.charge_total_amount == ( | ||||||
|  |         form.Amount(0.0)) | ||||||
|  |     assert inv.invoice_legal_monetary_total.payable_amount == ( | ||||||
|  |         form.Amount(100.0)) | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_invoice_ident_prefix_automatic_invalid(): | def test_invoice_ident_prefix_automatic_invalid(): | ||||||
| @@ -190,6 +213,7 @@ def test_invoice_ident_prefix_automatic_invalid(): | |||||||
|     with pytest.raises(ValueError): |     with pytest.raises(ValueError): | ||||||
|         inv.set_ident('SETPQJQJ1234567') |         inv.set_ident('SETPQJQJ1234567') | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_invoice_ident_prefix_automatic(): | def test_invoice_ident_prefix_automatic(): | ||||||
|     inv = form.NationalSalesInvoice() |     inv = form.NationalSalesInvoice() | ||||||
|     inv.set_ident('SETP1234567') |     inv.set_ident('SETP1234567') | ||||||
| @@ -207,12 +231,14 @@ def test_invoice_ident_prefix_automatic(): | |||||||
|     inv.set_ident('1234567') |     inv.set_ident('1234567') | ||||||
|     assert inv.invoice_ident_prefix == '' |     assert inv.invoice_ident_prefix == '' | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_invoice_ident_prefix_manual(): | def test_invoice_ident_prefix_manual(): | ||||||
|     inv = form.NationalSalesInvoice() |     inv = form.NationalSalesInvoice() | ||||||
|     inv.set_ident('SETP1234567') |     inv.set_ident('SETP1234567') | ||||||
|     inv.set_ident_prefix('SETA') |     inv.set_ident_prefix('SETA') | ||||||
|     assert inv.invoice_ident_prefix == 'SETA' |     assert inv.invoice_ident_prefix == 'SETA' | ||||||
|  |  | ||||||
|  |  | ||||||
| def test_invoice_ident_prefix_automatic_debit(): | def test_invoice_ident_prefix_automatic_debit(): | ||||||
|     inv = form.DebitNote(form.BillingReference('', '', '')) |     inv = form.DebitNote(form.BillingReference('', '', '')) | ||||||
|     inv.set_ident('ABCDEF1234567') |     inv.set_ident('ABCDEF1234567') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user