Commit 66392e21 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: Update constraint tests for only fail in when ledger is automated

parent 3a342ab0
......@@ -134,6 +134,12 @@ class TestSaleInvoiceTransaction(TestSlapOSConstraintMixin):
setter = invoice.setSpecialise
message = "Arity Error for Relation ['specialise'] and Type "\
"('Sale Trade Condition',), arity is equal to 0 but should be at least 1"
self.assertNotIn(message, self.getMessageList(invoice))
invoice = self.portal.accounting_module.newContent(
portal_type='Sale Invoice Transaction',
ledger='automated')
setter = invoice.setSpecialise
self.assertIn(message, self.getMessageList(invoice))
sale_condition = self.portal.sale_trade_condition_module.newContent(
......@@ -153,6 +159,11 @@ class TestSaleInvoiceTransaction(TestSlapOSConstraintMixin):
portal_type='Sale Invoice Transaction')
message = "Arity Error for Relation ['specialise'] and Type " + \
"('Sale Trade Condition',), arity is equal to 0 but should be at least 1"
self.assertNotIn(message, self.getMessageList(invoice))
invoice = self.portal.accounting_module.newContent(
portal_type='Sale Invoice Transaction',
ledger='automated')
self.assertIn(message, self.getMessageList(invoice))
sale_condition = self.portal.sale_trade_condition_module.newContent(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment