Changeset 12093 for main/waeup.ikoba/trunk
- Timestamp:
- 30 Nov 2014, 05:55:16 (10 years ago)
- 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 92 92 setSite(app) 93 93 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 94 101 # Add customer with subobjects 95 102 customer = createObject('waeup.Customer') … … 1105 1112 1106 1113 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) 1107 1120 # Customers can manage applications under certain conditions 1108 1121 self.browser.open(self.login_path) … … 1118 1131 self.assertTrue('Sample Application created.' in self.browser.contents) 1119 1132 application = self.customer['applications']['a102'] 1120 1121 1133 # Application can be edited ... 1122 1134 self.browser.getLink("a102").click() … … 1128 1140 self.browser.open(self.applications_path + '/a102/edit') 1129 1141 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'] 1130 1147 self.browser.getControl("Save").click() 1131 1148 self.assertEqual(application.title, 'My second app') -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py
r12092 r12093 134 134 products = grok.getSite()['products'].values() 135 135 if not appcat: 136 return products # ?????????????????136 return products 137 137 resultlist = [ 138 138 value for value in products if value.application_category == appcat]
Note: See TracChangeset for help on using the changeset viewer.