forked from activefrequency/pyavatax
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_currencycode.py
More file actions
45 lines (36 loc) · 1.07 KB
/
test_currencycode.py
File metadata and controls
45 lines (36 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from unittest import TestCase
from pyavatax.base import Document
class TestCurrencyCode(TestCase):
def test_currency_code_is_set_in_document_object(self):
currency = 'gbp'
doc = Document(
DocType='SalesInvoice',
CustomerCode='123456789',
DocCode='12345',
CompanyCode='COMPANY_CODE',
CurrencyCode=currency
)
doc.add_from_address(
Line1='000 Main Street',
City='New York',
Region='NY',
Country='US',
PostalCode='10000'
)
doc.add_to_address(
Line1='001 Main Street',
Line2='',
City='New York',
Region='NY',
Country='US',
PostalCode='10000'
)
doc.add_line(
LineNo='1',
ItemCode='123456789',
Qty=1,
Amount=str(100)
)
dictionary = doc.todict()
self.assertIn("CurrencyCode", dictionary.keys())
self.assertEqual(dictionary.get("CurrencyCode"), currency)