Changeset 12789


Ignore:
Timestamp:
18 Mar 2015, 13:57:45 (10 years ago)
Author:
uli
Message:

Add tests for PaymentItem?.to_string().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/payments/tests/test_payment.py

    r12775 r12789  
    370370        verifyClass(IPaymentItem, PaymentItem)
    371371        verifyObject(IPaymentItem, obj)
     372
     373    def test_to_string(self):
     374        # we can turn default PaymentItems into strings
     375        obj = PaymentItem()
     376        self.assertEqual(
     377            obj.to_string(), u"(u'0', u'', u'0.00')")
     378
     379    def test_to_string_none_values(self):
     380        # 'None' values are properly represented by to_string()
     381        obj = PaymentItem()
     382        obj.item_id = None
     383        self.assertEqual(
     384            obj.to_string(), u"(None, u'', u'0.00')")
     385
     386    def test_to_string_enocded_values(self):
     387        # to_string() copes with encoded strings
     388        obj = PaymentItem()
     389        obj.title = u'ümläut'
     390        self.assertEqual(
     391            obj.to_string(), u"(u'0', u'ümläut', u'0.00')")
Note: See TracChangeset for help on using the changeset viewer.