Changeset 12098


Ignore:
Timestamp:
30 Nov 2014, 21:00:30 (10 years ago)
Author:
Henrik Bettermann
Message:

Renaming batch 2

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/app.py

    r12097 r12098  
    4343    _curr_doc_id = 101
    4444
    45     _curr_app_id = 101
     45    _curr_con_id = 101
    4646
    4747    # Setup authentication for this app. Note: this is only
     
    8787        """
    8888        # lock.acquire() # lock data
    89         new_id = u'a%s' % (self._curr_app_id)
    90         self._curr_app_id += 1
     89        new_id = u'c%s' % (self._curr_con_id)
     90        self._curr_con_id += 1
    9191        # self._p_changed = True
    9292        # commit()
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/interfaces.py

    r12097 r12098  
    2929
    3030from waeup.ikoba.customers.vocabularies import (
    31     contextual_reg_num_source, GenderSource, nats_vocab, AppCatProductSource)
     31    contextual_reg_num_source, GenderSource, nats_vocab, ConCatProductSource)
    3232
    3333
     
    289289    product = schema.Choice(
    290290        title = _(u'Product'),
    291         source = AppCatProductSource(),
     291        source = ConCatProductSource(),
    292292        required = False,
    293293        )
     
    300300    product = schema.Choice(
    301301        title = _(u'Product'),
    302         source = AppCatProductSource(),
    303         required = True,
    304         )
     302        source = ConCatProductSource(),
     303        required = True,
     304        )
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12097 r12098  
    10681068        self.browser.getControl("Create contract").click()
    10691069        self.assertTrue('Sample Contract created.' in self.browser.contents)
    1070         contract = self.customer['contracts']['a102']
     1070        contract = self.customer['contracts']['c102']
    10711071
    10721072        # Contract can be edited
    1073         self.browser.getLink("a102").click()
     1073        self.browser.getLink("c102").click()
    10741074        self.browser.getLink("Manage").click()
    10751075        self.browser.getControl(name="form.product").value = ['SAM']
     
    10781078        self.assertTrue('Form has been saved.' in self.browser.contents)
    10791079        self.browser.getLink("View").click()
    1080         self.assertEqual(self.browser.url, self.contracts_path + '/a102/index')
     1080        self.assertEqual(self.browser.url, self.contracts_path + '/c102/index')
    10811081
    10821082        # Transitions can be performed
     
    11011101        self.assertTrue(
    11021102            'INFO - zope.mgr - customers.browser.ContractManageFormPage '
    1103             '- K1000000 - a102 - saved: title'
     1103            '- K1000000 - c102 - saved: title'
    11041104            in logcontent)
    11051105        self.assertTrue(
     
    11311131        self.browser.getControl("Create contract").click()
    11321132        self.assertTrue('Sample Contract created.' in self.browser.contents)
    1133         contract = self.customer['contracts']['a102']
     1133        contract = self.customer['contracts']['c102']
    11341134        # Contract can be edited ...
    1135         self.browser.getLink("a102").click()
    1136         self.browser.open(self.contracts_path + '/a102/edit')
     1135        self.browser.getLink("c102").click()
     1136        self.browser.open(self.contracts_path + '/c102/edit')
    11371137        #self.browser.getLink("Edit").click()
    11381138        self.assertTrue('The requested form is locked' in self.browser.contents)
    11391139        # Customer is in wrong state
    11401140        IWorkflowState(self.customer).setState(APPROVED)
    1141         self.browser.open(self.contracts_path + '/a102/edit')
     1141        self.browser.open(self.contracts_path + '/c102/edit')
    11421142        self.browser.getControl(name="form.title").value = 'My second app'
    11431143        # SAM is in the correct contract_category ...
     
    11461146        self.assertFalse('<option value="LIC">' in self.browser.contents)
    11471147        # So far last_product_id is None.
    1148         self.assertTrue(self.customer['contracts']['a102'].last_product_id is None)
     1148        self.assertTrue(self.customer['contracts']['c102'].last_product_id is None)
    11491149        self.browser.getControl(name="form.product").value = ['SAM']
    11501150        self.browser.getControl("Save").click()
    11511151        # After saving the form, last_product_id is set.
    1152         self.assertEqual(self.customer['contracts']['a102'].last_product_id, 'SAM')
     1152        self.assertEqual(self.customer['contracts']['c102'].last_product_id, 'SAM')
    11531153        self.assertTrue('Form has been saved.' in self.browser.contents)
    11541154        # Saving the form again does not unset last_product_id
    11551155        self.assertEqual(contract.title, 'My second app')
    11561156        self.browser.getControl("Save").click()
    1157         self.assertEqual(self.customer['contracts']['a102'].last_product_id, 'SAM')
     1157        self.assertEqual(self.customer['contracts']['c102'].last_product_id, 'SAM')
    11581158        self.assertTrue('Form has been saved.' in self.browser.contents)
    11591159        self.browser.getLink("View").click()
    1160         self.assertEqual(self.browser.url, self.contracts_path + '/a102/index')
     1160        self.assertEqual(self.browser.url, self.contracts_path + '/c102/index')
    11611161        # Customer can submit the form. The form is also saved.
    11621162        self.browser.getLink("Edit").click()
     
    11671167        self.assertTrue('Contract State: submitted for approval' in self.browser.contents)
    11681168        # Customer can't edit the contract once it has been submitted
    1169         self.browser.open(self.contracts_path + '/a102/edit')
     1169        self.browser.open(self.contracts_path + '/c102/edit')
    11701170        self.assertTrue('The requested form is locked' in self.browser.contents)
    11711171
     
    11811181        print "Sample PDF overview_slip.pdf written to %s" % path
    11821182        # Officers can open contract slips
    1183         self.browser.open(self.customer_path + '/contracts/a101')
     1183        self.browser.open(self.customer_path + '/contracts/c101')
    11841184        self.browser.getLink("Download contract slip").click()
    11851185        self.assertEqual(self.browser.headers['Status'], '200 Ok')
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_catalog.py

    r12097 r12098  
    187187        logcontent = open(logfile).read()
    188188        self.assertTrue(
    189             'INFO - system - ObjectRemovedEvent - K1000000 - a101 - removed: product\n'
     189            'INFO - system - ObjectRemovedEvent - K1000000 - c101 - removed: product\n'
    190190            in logcontent)
    191191
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py

    r12097 r12098  
    120120
    121121
    122 class AppCatProductSource(SmartBasicContextualSourceFactory):
     122class ConCatProductSource(SmartBasicContextualSourceFactory):
    123123    """An contract category product delivers all products
    124124    which belong to a certain contract_category.
    125125    """
    126126    def contains(self, context, value):
    127         appcat = getattr(context, 'contract_category', None)
    128         if value.contract_category == appcat:
     127        concat = getattr(context, 'contract_category', None)
     128        if value.contract_category == concat:
    129129            return True
    130130        return False
    131131
    132132    def getValues(self, context):
    133         appcat = getattr(context, 'contract_category', None)
     133        concat = getattr(context, 'contract_category', None)
    134134        products = grok.getSite()['products'].values()
    135         if not appcat:
     135        if not concat:
    136136            return products
    137137        resultlist = [
    138             value for value in products if value.contract_category == appcat]
     138            value for value in products if value.contract_category == concat]
    139139        return resultlist
    140140
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/interfaces.py

    r12097 r12098  
    2323from waeup.ikoba.interfaces import MessageFactory as _
    2424
    25 class AppCatSource(ContextualDictSourceFactoryBase):
     25class ConCatSource(ContextualDictSourceFactoryBase):
    2626    """A contract category source delivers all contract categories
    2727    provided in the portal.
    2828    """
    2929    #: name of dict to deliver from kofa utils.
    30     DICT_NAME = 'APP_CATS_DICT'
     30    DICT_NAME = 'CON_CATS_DICT'
    3131
    3232class IProductsContainer(IIkobaObject):
     
    5757    contract_category = schema.Choice(
    5858        title = _(u'Contract Category'),
    59         source = AppCatSource(),
     59        source = ConCatSource(),
    6060        default = u'license',
    6161        required = True,
  • main/waeup.ikoba/trunk/src/waeup/ikoba/utils/utils.py

    r12092 r12098  
    102102        return sorted_phone_prefixes(data, request)
    103103
    104     APP_CATS_DICT = {
     104    CON_CATS_DICT = {
    105105        'sample': 'Sample Category',
    106106        'license': 'License',
    107         'no': 'no application',
     107        'no': 'no contract',
    108108        }
    109109
Note: See TracChangeset for help on using the changeset viewer.