Ignore:
Timestamp:
1 Jan 2015, 07:44:44 (10 years ago)
Author:
Henrik Bettermann
Message:

Do not allow to add documents if customer has not yet been approved.

Rename pagetemplate.

File:
1 edited

Legend:

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

    r12353 r12356  
    931931        self.browser.getLink("Documents").click()
    932932        self.browser.getControl("Add document").click()
     933        self.assertTrue('The requested form is locked' in self.browser.contents)
     934        # Customer is in wrong state
     935        IWorkflowState(self.customer).setState(APPROVED)
     936        self.browser.getControl("Add document").click()
    933937        self.browser.getControl(name="doctype").value = ['CustomerSampleDocument']
    934938        self.browser.getControl(name="form.title").value = 'My Sample Document'
     
    937941        docid = [i for i in self.customer['documents'].keys() if len(i) > 10][0]
    938942        document = self.customer['documents'][docid]
    939 
    940         # Document can be edited ...
    941         self.browser.getLink(docid[:6]).click()
    942         self.browser.open(self.documents_path + '/' + docid + '/edit')
    943         #self.browser.getLink("Edit").click()
    944         self.assertTrue('The requested form is locked' in self.browser.contents)
    945         # Customer is in wrong state
    946         IWorkflowState(self.customer).setState(APPROVED)
    947         self.browser.open(self.documents_path + '/' + docid + '/edit')
    948943        self.browser.getControl(name="form.title").value = 'My second doc'
    949944        self.browser.getControl("Save").click()
     
    953948        self.assertEqual(
    954949            self.browser.url, self.documents_path + '/%s/index' % docid)
    955         # Costumer can upload a document.
     950        # Customer can upload a document.
    956951        self.browser.getLink("Edit").click()
    957952        ctrl = self.browser.getControl(name='samplescaneditupload')
     
    964959            'href="http://localhost/app/customers/K1000000/documents/%s/sample"'
    965960            % docid in self.browser.contents)
    966         # Costumer can submit the form. The form is also saved.
     961        # Customer can submit the form. The form is also saved.
    967962        self.browser.getControl(name="form.title").value = 'My third doc'
    968963        self.browser.getControl("Final Submit").click()
     
    12171212            in logcontent)
    12181213        self.assertTrue(
    1219             'INFO - zope.mgr - customers.browser.ContractAddPage '
     1214            'INFO - zope.mgr - customers.browser.ContractAddFormPage '
    12201215            '- K1000000 - added: Sample Contract %s'
    12211216            % contract.contract_id in logcontent)
Note: See TracChangeset for help on using the changeset viewer.