Changeset 12093


Ignore:
Timestamp:
30 Nov 2014, 05:55:16 (10 years ago)
Author:
Henrik Bettermann
Message:

Test AppCatProductSource? in browser test.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/customers
Files:
2 edited

Legend:

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

    r12091 r12093  
    9292        setSite(app)
    9393
     94        # Add some products
     95        self.product = createObject('waeup.Product')
     96        self.product.product_id = u'SAM'
     97        self.product.title = u'Our Samle Product'
     98        self.product.application_category = u'sample'
     99        self.app['products'].addProduct(self.product)
     100
    94101        # Add customer with subobjects
    95102        customer = createObject('waeup.Customer')
     
    11051112
    11061113    def test_edit_sample_application(self):
     1114        # We add a second product.
     1115        product = createObject('waeup.Product')
     1116        product.product_id = u'LIC'
     1117        product.title = u'Our License Product'
     1118        product.application_category = u'license'
     1119        self.app['products'].addProduct(product)
    11071120        # Customers can manage applications under certain conditions
    11081121        self.browser.open(self.login_path)
     
    11181131        self.assertTrue('Sample Application created.' in self.browser.contents)
    11191132        application = self.customer['applications']['a102']
    1120 
    11211133        # Application can be edited ...
    11221134        self.browser.getLink("a102").click()
     
    11281140        self.browser.open(self.applications_path + '/a102/edit')
    11291141        self.browser.getControl(name="form.title").value = 'My second app'
     1142        # SAM is in the correct application_category ...
     1143        self.assertTrue('<option value="SAM">' in self.browser.contents)
     1144        # ... but NOTSAM not.
     1145        self.assertFalse('<option value="LIC">' in self.browser.contents)
     1146        self.browser.getControl(name="form.product").value = ['SAM']
    11301147        self.browser.getControl("Save").click()
    11311148        self.assertEqual(application.title, 'My second app')
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py

    r12092 r12093  
    134134        products = grok.getSite()['products'].values()
    135135        if not appcat:
    136             return products   # ?????????????????
     136            return products
    137137        resultlist = [
    138138            value for value in products if value.application_category == appcat]
Note: See TracChangeset for help on using the changeset viewer.