Ignore:
Timestamp:
2 Dec 2014, 14:38:31 (10 years ago)
Author:
Henrik Bettermann
Message:

Implement HREFDisplayWidget which renders a persistent object title inside an anchor element
referring to the object.

File:
1 edited

Legend:

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

    r12112 r12119  
    10741074        self.browser.getLink("c102").click()
    10751075        self.browser.getLink("Manage").click()
    1076         self.browser.getControl(name="form.product").value = ['SAM']
     1076        self.browser.getControl(name="form.product_object").value = ['SAM']
    10771077        self.browser.getControl(name="form.title").value = 'My second contract'
    10781078        self.browser.getControl("Save").click()
     
    11341134        contract = self.customer['contracts']['c102']
    11351135        # Contract can be edited ...
    1136         self.browser.getLink("c102").click()
    11371136        self.browser.open(self.contracts_path + '/c102/edit')
    11381137        #self.browser.getLink("Edit").click()
     
    11481147        # So far last_product_id is None.
    11491148        self.assertTrue(self.customer['contracts']['c102'].last_product_id is None)
    1150         self.browser.getControl(name="form.product").value = ['SAM']
     1149        self.browser.getControl(name="form.product_object").value = ['SAM']
    11511150        self.browser.getControl("Save").click()
    11521151        # Document is a required field on edit form page.
     
    11571156        IWorkflowState(self.document).setState(SUBMITTED)
    11581157        self.browser.open(self.contracts_path + '/c102/edit')
    1159         self.browser.getControl(name="form.product").value = ['SAM']
    1160         self.browser.getControl(name="form.document").value = ['d101']
     1158        self.browser.getControl(name="form.product_object").value = ['SAM']
     1159        self.browser.getControl(name="form.document_object").value = ['d101']
    11611160        self.browser.getControl(name="form.title").value = 'My second contract'
    11621161        self.browser.getControl("Save").click()
     
    11651164        self.assertEqual(self.customer['contracts']['c102'].last_product_id, 'SAM')
    11661165        self.assertEqual(contract.title, 'My second contract')
    1167         self.assertEqual(contract.product, self.product)
    1168         self.assertEqual(contract.document, self.document)
     1166        self.assertEqual(contract.product_object, self.product)
     1167        self.assertEqual(contract.document_object, self.document)
    11691168        # Saving the form again does not unset last_product_id
    11701169        self.browser.getControl(name="form.title").value = 'My third contract'
     
    11741173        self.browser.getLink("View").click()
    11751174        self.assertEqual(self.browser.url, self.contracts_path + '/c102/index')
     1175        # An href attribute is referring to the document and product objects
     1176        self.assertTrue('<a href="http://localhost/app/products/SAM">SAM -'
     1177            in self.browser.contents)
     1178        self.assertTrue(
     1179            '<a href="http://localhost/app/customers/K1000000/documents/d101">d101 -'
     1180            in self.browser.contents)
    11761181        # Customer can submit the form. The form is also saved.
    11771182        self.browser.getLink("Edit").click()
Note: See TracChangeset for help on using the changeset viewer.