Ignore:
Timestamp:
3 Jan 2015, 21:31:04 (10 years ago)
Author:
Henrik Bettermann
Message:

Some modifications to enable customization.

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  
    14991499    """Deliver pdf file including metadata.
    15001500    """
    1501     grok.context(ISampleContract)
     1501    grok.context(IContract)
    15021502    grok.name('contract_slip.pdf')
    15031503    grok.require('waeup.viewCustomer')
     
    15071507                   'suspended_comment',)
    15081508
    1509     form_fields = grok.AutoFields(ISampleContract)
     1509    @property
     1510    def form_fields(self):
     1511        return grok.AutoFields(self.context.form_fields_interface)
    15101512
    15111513    @property
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py

    r12366 r12388  
    8484    layer = FunctionalLayer
    8585
     86    def setup_customizable_params(self):
     87        self._contract_category = u'sample'
     88        return
     89
    8690    def setUp(self):
    8791        super(CustomerImportExportSetup, self).setUp()
     92        self.setup_customizable_params()
    8893        self.dc_root = tempfile.mkdtemp()
    8994        self.workdir = tempfile.mkdtemp()
     
    100105        self.product.product_id = u'SAM'
    101106        self.product.title = u'Our Sample Product'
    102         self.product.contract_category = u'sample'
     107        self.product.contract_category = self._contract_category
    103108        self.product.valid_from = datetime.date(2015, 12, 4)
    104109        self.product.tc_dict = {'en': u'Hello world'}
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12387 r12388  
    8383    layer = FunctionalLayer
    8484
    85     # This property has to be customied in custom packages.
    86     # the sample category might not be available.
    87     @property
    88     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
    9090
    9191    def setUp(self):
    9292        super(CustomersFullSetup, self).setUp()
    93 
     93        self.setup_customizable_params()
    9494        # Setup a sample site for each test
    9595        app = Company()
     
    133133        self.customer_id = customer.customer_id
    134134        self.customer = self.app['customers'][self.customer_id]
    135         self.document = createObject('waeup.CustomerSampleDocument')
     135        self.document = createObject(self._document_factory)
    136136        self.document.title = u'My first document'
    137137        self.document.document_id = u'DOC1'
     
    139139            NotIdValue, setattr, self.document, 'document_id', u'id with spaces')
    140140        self.customer['documents'].addDocument(self.document)
    141         self.contract = createObject('waeup.SampleContract')
     141        self.contract = createObject(self._contract_factory)
    142142        self.contract.contract_id = u'CON1'
    143143        self.assertRaises(
Note: See TracChangeset for help on using the changeset viewer.