Changeset 12095 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Timestamp:
- 30 Nov 2014, 09:12:44 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/applications.py
r12094 r12095 29 29 from waeup.ikoba.customers.interfaces import ( 30 30 IApplicationsContainer, ICustomerNavigation, 31 IApplication, I CustomersUtils,31 IApplication, IApplicationEdit, ICustomersUtils, 32 32 ) 33 33 from waeup.ikoba.customers.utils import generate_application_id … … 59 59 """This is a customer application baseclass. 60 60 """ 61 grok.implements(IApplication, I CustomerNavigation)61 grok.implements(IApplication, IApplicationEdit, ICustomerNavigation) 62 62 grok.provides(IApplication) 63 63 grok.baseclass() -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12094 r12095 51 51 ICustomer, ICustomersContainer, ICustomerRequestPW, ICustomersUtils, 52 52 ICustomerDocument, ICustomerDocumentsContainer, ICustomerCreate, 53 ICustomerPDFDocument, IApplicationsContainer, IApplication 53 ICustomerPDFDocument, IApplicationsContainer, IApplication, IApplicationEdit 54 54 ) 55 55 from waeup.ikoba.customers.catalog import search … … 1183 1183 grok.name('edit') 1184 1184 grok.require('waeup.handleCustomer') 1185 form_fields = grok.AutoFields(IApplicationEdit).omit('last_transition_date') 1185 1186 1186 1187 def update(self): -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/interfaces.py
r12094 r12095 290 290 title = _(u'Product'), 291 291 source = AppCatProductSource(), 292 required = True, 293 ) 292 required = False, 293 ) 294 295 class IApplicationEdit(IApplication): 296 """Interface for editing application data by customers. 297 298 """ 299 300 product = schema.Choice( 301 title = _(u'Product'), 302 source = AppCatProductSource(), 303 required = True, 304 ) -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_catalog.py
r12094 r12095 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 import os 18 19 import grok 19 20 import shutil … … 167 168 assert results[0] is self.customer['applications'][self.application_id] 168 169 assert results[0].product is self.product 170 171 def test_product_removal(self): 172 # This test does not only test catalog components, it also ensures 173 # that the product attribute of an application is cleared 174 # but the last_product_id is not. 175 del self.app['products'][self.product_id] 176 self.assertTrue(self.application.product is None) 177 self.assertEqual(self.application.last_product_id, 'SAM') 178 cat = queryUtility(ICatalog, name='applications_catalog') 179 results = cat.searchResults(last_product_id=('SAM', 'SAM')) 180 results = [x for x in results] 181 assert len(results) == 1 182 assert results[0] is self.customer['applications'][self.application_id] 183 assert results[0].product is None 184 # Product removal is being logged in customers.log 185 logfile = os.path.join( 186 self.app['datacenter'].storage, 'logs', 'customers.log') 187 logcontent = open(logfile).read() 188 self.assertTrue( 189 'INFO - system - ObjectRemovedEvent - K1000000 - a101 - removed: product\n' 190 in logcontent) 191
Note: See TracChangeset for help on using the changeset viewer.