- Timestamp:
- 17 Mar 2015, 18:41:43 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/payments
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/payments/export.py
r12777 r12779 38 38 @property 39 39 def fields(self): 40 return tuple(sorted(iface_names(self.iface )))40 return tuple(sorted(iface_names(self.iface, exclude_attribs=False))) 41 41 42 42 def mangle_value(self, value, name, context=None): -
main/waeup.ikoba/trunk/src/waeup/ikoba/payments/interfaces.py
r12773 r12779 358 358 ) 359 359 360 payment_items = Attribute("Tuple of payment items") 361 360 362 amount = Attribute("Sum of amounts of items contained") 361 363 -
main/waeup.ikoba/trunk/src/waeup/ikoba/payments/payment.py
r12774 r12779 257 257 self.amount = amount 258 258 259 def to_string(self): 260 """A string representation that can be used in exports. 261 262 Returned is a unicode string of format ``(u'<TITLE>',u'<FEE>',u'<CURR>')``. 263 """ 264 string = u"(u'%s', u'%s', u'%s')" % (self.item_id, self.title, self.amount) 265 string = string.replace("u'None'", "None") 266 return string 267 259 268 260 269 @attrs_to_fields -
main/waeup.ikoba/trunk/src/waeup/ikoba/payments/tests/test_export.py
r12777 r12779 105 105 self.assertTrue( 106 106 'creation_date,currency,gateway_service,payable_id,payee_id,' 107 'payer_id,payment_date,payment_id, state,title\r\n'107 'payer_id,payment_date,payment_id,payment_items,state,title\r\n' 108 108 in result) 109 109 self.assertMatches( 110 110 '...2015-03-16 16:07:33.273297#,EUR,demo_creditcard,CON1,' 111 ',K1000000,,%s,64,My Contract...' % self.payment.payment_id, 111 ',K1000000,,%s,"[(u\'0\', u\'Any product option\', u\'88.8\')]",' 112 '64,My Contract...' % self.payment.payment_id, 112 113 result 113 114 ) … … 121 122 self.assertTrue( 122 123 'creation_date,currency,gateway_service,payable_id,payee_id,' 123 'payer_id,payment_date,payment_id, state,title\r\n'124 'payer_id,payment_date,payment_id,payment_items,state,title\r\n' 124 125 in result) 125 126 self.assertMatches( 126 127 '...2015-03-16 16:07:33.273297#,EUR,demo_creditcard,CON1,' 127 ',K1000000,,%s,64,My Contract...' % self.payment.payment_id, 128 ',K1000000,,%s,"[(u\'0\', u\'Any product option\', u\'88.8\')]",' 129 '64,My Contract...' % self.payment.payment_id, 128 130 result 129 131 )
Note: See TracChangeset for help on using the changeset viewer.