Ignore:
Timestamp:
15 Mar 2015, 13:02:49 (10 years ago)
Author:
Henrik Bettermann
Message:

Add constraint to forbid the selection of options with different currencies.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12750 r12768  
    4949from waeup.ikoba.browser.tests.test_pdf import samples_dir
    5050from waeup.ikoba.products.productoptions import ProductOption
     51from waeup.ikoba.customers.interfaces import CurrencyMismatch
    5152
    5253PH_LEN = 15911  # Length of placeholder file
     
    12971298        contract.product_options = [prodoption, ]
    12981299
     1300    def test_multiple_currencies(self):
     1301        prodoption1 = ProductOption()
     1302        prodoption1.title = u'Any product option in Euros'
     1303        prodoption1.fee = Decimal('88.8')
     1304        prodoption1.currency = 'EUR'
     1305        prodoption2 = ProductOption()
     1306        prodoption2.title = u'Any product option in Dollars'
     1307        prodoption2.fee = Decimal('99.9')
     1308        prodoption2.currency = 'USD'
     1309        self.assertRaises(CurrencyMismatch,
     1310                          setattr, self.contract,
     1311                          'product_options',
     1312                          [prodoption1, prodoption2]
     1313                          )
     1314
    12991315    def prepare_payment_select(self):
    13001316        IWorkflowState(self.customer).setState('approved')
Note: See TracChangeset for help on using the changeset viewer.