Changeset 12388 for main/waeup.ikoba
- Timestamp:
- 3 Jan 2015, 21:31:04 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12368 r12388 1499 1499 """Deliver pdf file including metadata. 1500 1500 """ 1501 grok.context(I SampleContract)1501 grok.context(IContract) 1502 1502 grok.name('contract_slip.pdf') 1503 1503 grok.require('waeup.viewCustomer') … … 1507 1507 'suspended_comment',) 1508 1508 1509 form_fields = grok.AutoFields(ISampleContract) 1509 @property 1510 def form_fields(self): 1511 return grok.AutoFields(self.context.form_fields_interface) 1510 1512 1511 1513 @property -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py
r12366 r12388 84 84 layer = FunctionalLayer 85 85 86 def setup_customizable_params(self): 87 self._contract_category = u'sample' 88 return 89 86 90 def setUp(self): 87 91 super(CustomerImportExportSetup, self).setUp() 92 self.setup_customizable_params() 88 93 self.dc_root = tempfile.mkdtemp() 89 94 self.workdir = tempfile.mkdtemp() … … 100 105 self.product.product_id = u'SAM' 101 106 self.product.title = u'Our Sample Product' 102 self.product.contract_category = u'sample'107 self.product.contract_category = self._contract_category 103 108 self.product.valid_from = datetime.date(2015, 12, 4) 104 109 self.product.tc_dict = {'en': u'Hello world'} -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12387 r12388 83 83 layer = FunctionalLayer 84 84 85 # This property has to be customied in custom packages.86 # the sample category might not be available.87 @property88 def _contract_category(self):89 return u'sample'85 def setup_customizable_params(self): 86 self._contract_category = u'sample' 87 self._document_factory = 'waeup.CustomerSampleDocument' 88 self._contract_factory = 'waeup.SampleContract' 89 return 90 90 91 91 def setUp(self): 92 92 super(CustomersFullSetup, self).setUp() 93 93 self.setup_customizable_params() 94 94 # Setup a sample site for each test 95 95 app = Company() … … 133 133 self.customer_id = customer.customer_id 134 134 self.customer = self.app['customers'][self.customer_id] 135 self.document = createObject( 'waeup.CustomerSampleDocument')135 self.document = createObject(self._document_factory) 136 136 self.document.title = u'My first document' 137 137 self.document.document_id = u'DOC1' … … 139 139 NotIdValue, setattr, self.document, 'document_id', u'id with spaces') 140 140 self.customer['documents'].addDocument(self.document) 141 self.contract = createObject( 'waeup.SampleContract')141 self.contract = createObject(self._contract_factory) 142 142 self.contract.contract_id = u'CON1' 143 143 self.assertRaises(
Note: See TracChangeset for help on using the changeset viewer.