File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -46,3 +46,31 @@ def test_create(self):
46
46
self .assertEquals (query_invoice .CustomerMemo .value , "Customer Memo" )
47
47
self .assertEquals (query_invoice .Line [0 ].Description , "description" )
48
48
self .assertEquals (query_invoice .Line [0 ].Amount , 100.0 )
49
+
50
+ def test_delete (self ):
51
+ # First create an invoice
52
+ invoice = Invoice ()
53
+
54
+ line = SalesItemLine ()
55
+ line .LineNum = 1
56
+ line .Description = "description"
57
+ line .Amount = 100
58
+ line .SalesItemLineDetail = SalesItemLineDetail ()
59
+ item = Item .all (max_results = 1 , qb = self .qb_client )[0 ]
60
+
61
+ line .SalesItemLineDetail .ItemRef = item .to_ref ()
62
+ invoice .Line .append (line )
63
+
64
+ customer = Customer .all (max_results = 1 , qb = self .qb_client )[0 ]
65
+ invoice .CustomerRef = customer .to_ref ()
66
+
67
+ invoice .CustomerMemo = CustomerMemo ()
68
+ invoice .CustomerMemo .value = "Customer Memo"
69
+ invoice .save (qb = self .qb_client )
70
+
71
+ # Then delete
72
+ invoice_id = invoice .Id
73
+ invoice .delete (qb = self .qb_client )
74
+
75
+ query_invoice = Invoice .filter (Id = invoice_id , qb = self .qb_client )
76
+ self .assertEqual ([], query_invoice )
You can’t perform that action at this time.
0 commit comments