Changeset 12585 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests
- Timestamp:
- 10 Feb 2015, 15:39:09 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12580 r12585 113 113 self.product.title = u'Our Sample Product' 114 114 self.product.contract_category = self._contract_category 115 self.product.valid_from = date(201 5, 12, 4)115 self.product.valid_from = date(2014, 12, 4) 116 116 self.product.tc_dict = {'en': u'Hello world'} 117 117 prodoption = ProductOption() … … 1265 1265 self.assertEqual( 1266 1266 self.browser.url, self.contracts_path + '/%s/selectproduct' % conid) 1267 # SAM is in the correct contract_category ...1267 # SAM is in the correct contract_category 1268 1268 self.assertTrue('<option value="SAM">' in self.browser.contents) 1269 # ... but NOTSAM not.1270 self.assertFalse('<option value="LIC">' in self.browser.contents)1271 1269 # So far last_product_id is None. 1272 1270 self.assertTrue(self.customer['contracts'][conid].last_product_id is None) … … 1331 1329 product.title = u'Our License Product' 1332 1330 product.contract_category = u'license' 1331 product.valid_from = date(2014, 12, 4) 1333 1332 self.app['products'].addProduct(product) 1334 1333 # Customers can manage contracts under certain conditions … … 1357 1356 # SAM is in the correct contract_category ... 1358 1357 self.assertTrue('<option value="SAM">' in self.browser.contents) 1359 # ... but NOTSAMnot.1358 # ... but LIC not. 1360 1359 self.assertFalse('<option value="LIC">' in self.browser.contents) 1361 1360 # So far last_product_id is None. -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_interfaces.py
r12351 r12585 23 23 import tempfile 24 24 import shutil 25 from datetime import date 25 26 from zope.component.hooks import setSite 26 27 from zope.component import queryUtility, createObject … … 29 30 from waeup.ikoba.interfaces import SUBMITTED 30 31 from waeup.ikoba.customers.vocabularies import ( 31 ConCatProductSource, C ustomerDocumentSource)32 ConCatProductSource, ConCatActiveProductSource, CustomerDocumentSource) 32 33 from waeup.ikoba.testing import FunctionalLayer, FunctionalTestCase 33 34 … … 96 97 self.assertEqual(result, u'SAM - Our Sample Product') 97 98 99 def test_getValues_ConCatActiveProductSource(self): 100 source = ConCatActiveProductSource() 101 self.product.valid_from = date(2030, 12, 4) 102 self.product.valid_to = None 103 self.product.contract_category = u'sample' 104 result = source.factory.getValues(self.contract) 105 self.assertFalse(self.product in result) 106 self.product.valid_from = None 107 self.product.valid_to = date(2030, 12, 4) 108 self.product.contract_category = u'sample' 109 result = source.factory.getValues(self.contract) 110 self.assertTrue(self.product in result) 111 self.product.valid_from = None 112 self.product.valid_to = date(2010, 12, 4) 113 self.product.contract_category = u'sample' 114 result = source.factory.getValues(self.contract) 115 self.assertFalse(self.product in result) 116 self.product.valid_from = date(2010, 12, 4) 117 self.product.valid_to = None 118 self.product.contract_category = u'sample' 119 result = source.factory.getValues(self.contract) 120 self.assertTrue(self.product in result) 121 98 122 def test_getValues_CustomerDocumentSource(self): 99 123 source = CustomerDocumentSource()
Note: See TracChangeset for help on using the changeset viewer.