|
|
@ -31,7 +31,7 @@ class TestAccountInvoiceController(BaseEMCRestCase): |
|
|
|
today = Date.to_string(Date.today()) |
|
|
|
self.demo_invoice_dict = { |
|
|
|
"id": 1, |
|
|
|
"name": "Capital Release Example", |
|
|
|
"number": "xxx", # can't guess it |
|
|
|
"partner": {"id": 1, "name": "Catherine des Champs"}, |
|
|
|
"account": {"id": 1, "name": "Cooperators"}, |
|
|
|
"journal": {"id": 1, "name": "Subscription Journal"}, |
|
|
@ -79,7 +79,7 @@ class TestAccountInvoiceController(BaseEMCRestCase): |
|
|
|
|
|
|
|
self.capital_release = self.env["account.invoice"].create( |
|
|
|
{ |
|
|
|
"name": "Capital Release Example", |
|
|
|
"number": "Capital Release Example", |
|
|
|
"partner_id": self.coop_candidate.id, |
|
|
|
"type": "out_invoice", |
|
|
|
"invoice_line_ids": capital_release_line, |
|
|
@ -92,10 +92,14 @@ class TestAccountInvoiceController(BaseEMCRestCase): |
|
|
|
def test_service_get(self): |
|
|
|
external_id = self.capital_release.get_api_external_id() |
|
|
|
result = self.ai_service.get(external_id) |
|
|
|
self.assertEquals(self.demo_invoice_dict, result) |
|
|
|
expected = self.demo_invoice_dict.copy() |
|
|
|
expected["number"] = result["number"] |
|
|
|
self.assertEquals(expected, result) |
|
|
|
|
|
|
|
def test_route_get(self): |
|
|
|
external_id = self.capital_release.get_api_external_id() |
|
|
|
route = "/api/invoice/%s" % external_id |
|
|
|
content = self.http_get_content(route) |
|
|
|
self.assertEquals(self.demo_invoice_dict, content) |
|
|
|
expected = self.demo_invoice_dict.copy() |
|
|
|
expected["number"] = content["number"] |
|
|
|
self.assertEquals(expected, content) |