[POS-commit] r6343 - in stoqlib/trunk/stoqlib/domain: payment test

fabio morbec fabio at async.com.br
Mon Apr 9 09:19:54 BRT 2007


Author: fabio
Date: Mon Apr  9 09:19:53 2007
New Revision: 6343

Modified:
   stoqlib/trunk/stoqlib/domain/payment/methods.py
   stoqlib/trunk/stoqlib/domain/test/test_payment_method.py

Log:
#3286: Vendas a prazo nao mostra informação correta das parcelas. r=jdahlin.



Modified: stoqlib/trunk/stoqlib/domain/payment/methods.py
==============================================================================
--- stoqlib/trunk/stoqlib/domain/payment/methods.py	(original)
+++ stoqlib/trunk/stoqlib/domain/payment/methods.py	Mon Apr  9 09:19:53 2007
@@ -318,7 +318,8 @@
         assert installments > 0
         assert installments >= installment
         group_desc = payment_group.get_group_description()
-        return _(u'1/1 %s for %s') % (self.description, group_desc)
+        return _(u'%s/%s %s for %s') % (installment, installments,
+                                        self.description, group_desc)
 
     @argcheck(AbstractPaymentGroup, Decimal, datetime.datetime, object,
               basestring, Decimal)

Modified: stoqlib/trunk/stoqlib/domain/test/test_payment_method.py
==============================================================================
--- stoqlib/trunk/stoqlib/domain/test/test_payment_method.py	(original)
+++ stoqlib/trunk/stoqlib/domain/test/test_payment_method.py	Mon Apr  9 09:19:53 2007
@@ -130,6 +130,10 @@
         self.assertRaises(AssertionError, method.describe_payment, group, 0)
         self.assertRaises(AssertionError, method.describe_payment, group, 1, 0)
         self.assertRaises(AssertionError, method.describe_payment, group, 2, 1)
+        desc = method.describe_payment(group, 123, 456)
+        self.failUnless('123' in desc, desc)
+        self.failUnless('456' in desc, desc)
+        self.failUnless('123/456' in desc, desc)
 
     def testGetByEnum(self):
         self.assertEqual(APaymentMethod.get_by_enum(self.trans,


More information about the POS-commit mailing list