3
3
import filecmp
4
4
from decimal import Decimal
5
5
from pathlib import Path
6
- from pydoc import pager
7
6
8
7
import pytest
9
- from black import nullcontext
10
8
from dateutil import tz
11
9
12
10
from xero_python .accounting import (
@@ -347,9 +345,9 @@ def test_get_invoices(sandbox_accounting_api: AccountingApi, xero_tenant_id):
347
345
expected = Invoices (
348
346
invoices = [
349
347
Invoice (
350
- amount_credited = Decimal ("0" ),
351
- amount_due = Decimal ("0" ),
352
- amount_paid = Decimal ("0" ),
348
+ amount_credited = Decimal (0 ),
349
+ amount_due = Decimal (0 ),
350
+ amount_paid = Decimal (0 ),
353
351
contact = Contact (
354
352
addresses = [],
355
353
contact_groups = [],
@@ -379,16 +377,16 @@ def test_get_invoices(sandbox_accounting_api: AccountingApi, xero_tenant_id):
379
377
repeating_invoice_id = "428c0d75-909f-4b04-8403-a48dc27283b0" ,
380
378
sent_to_contact = True ,
381
379
status = "VOIDED" ,
382
- sub_total = Decimal ("40" ),
383
- total = Decimal ("40" ),
384
- total_tax = Decimal ("0" ),
380
+ sub_total = Decimal (40 ),
381
+ total = Decimal (40 ),
382
+ total_tax = Decimal (0 ),
385
383
type = "ACCREC" ,
386
384
updated_date_utc = datetime .datetime (2018 , 11 , 2 , 16 , 31 , 30 , 160000 , tzinfo = tz .UTC ),
387
385
),
388
386
Invoice (
389
- amount_credited = Decimal ("0" ),
390
- amount_due = Decimal ("0" ),
391
- amount_paid = Decimal ("46" ),
387
+ amount_credited = Decimal (0 ),
388
+ amount_due = Decimal (0 ),
389
+ amount_paid = Decimal (46 ),
392
390
contact = Contact (
393
391
addresses = [],
394
392
contact_groups = [],
@@ -415,7 +413,7 @@ def test_get_invoices(sandbox_accounting_api: AccountingApi, xero_tenant_id):
415
413
overpayments = [],
416
414
payments = [
417
415
Payment (
418
- amount = Decimal ("46" ),
416
+ amount = Decimal (46 ),
419
417
currency_rate = Decimal (1 ),
420
418
date = datetime .date (2018 , 11 , 29 ),
421
419
has_account = False ,
@@ -428,16 +426,16 @@ def test_get_invoices(sandbox_accounting_api: AccountingApi, xero_tenant_id):
428
426
#repeating_invoice_id="428c0d75-909f-4b04-8403-a48dc27283b0",
429
427
sent_to_contact = True ,
430
428
status = "PAID" ,
431
- sub_total = Decimal ("40" ),
432
- total = Decimal ("46" ),
433
- total_tax = Decimal ("6" ),
429
+ sub_total = Decimal (40 ),
430
+ total = Decimal (46 ),
431
+ total_tax = Decimal (6 ),
434
432
type = "ACCREC" ,
435
433
updated_date_utc = datetime .datetime (2018 , 11 , 2 , 16 , 36 , 32 , 690000 , tzinfo = tz .UTC ),
436
434
),
437
435
Invoice (
438
436
amount_credited = Decimal (0 ),
439
437
amount_due = Decimal (115 ),
440
- amount_paid = Decimal ("0" ),
438
+ amount_paid = Decimal (0 ),
441
439
contact = Contact (
442
440
addresses = [],
443
441
contact_groups = [],
@@ -465,9 +463,9 @@ def test_get_invoices(sandbox_accounting_api: AccountingApi, xero_tenant_id):
465
463
prepayments = [],
466
464
reference = "" ,
467
465
status = "AUTHORISED" ,
468
- sub_total = Decimal (" 100" ),
469
- total = Decimal (" 115" ),
470
- total_tax = Decimal ("15" ),
466
+ sub_total = Decimal (100 ),
467
+ total = Decimal (115 ),
468
+ total_tax = Decimal (15 ),
471
469
type = "ACCREC" ,
472
470
updated_date_utc = datetime .datetime (2018 , 11 , 2 , 16 , 37 , 28 , 927000 , tzinfo = tz .UTC )
473
471
)
0 commit comments