Changeset 12315
- Timestamp:
- 24 Dec 2014, 16:00:58 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/products
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/products/export.py
r12077 r12315 48 48 for local_role, user_name, setting in role_map.getPrincipalsAndRoles(): 49 49 value.append({'user_name':user_name,'local_role':local_role}) 50 if name == 'options' and value is not None: 51 value = [eval(entry.to_string()) for entry in value] 50 52 return super(ProductExporter, self).mangle_value( 51 53 value, name, context) -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_batching.py
r12288 r12315 25 25 import datetime 26 26 import grok 27 from decimal import Decimal 27 28 from time import time 28 29 from zope.event import notify … … 37 38 from waeup.ikoba.products.batching import ProductProcessor 38 39 from waeup.ikoba.products.product import Product 40 from waeup.ikoba.products.productoptions import ProductOptionEntry 39 41 from waeup.ikoba.testing import FunctionalLayer, FunctionalTestCase 40 42 … … 81 83 product = Product() 82 84 product.product_id = u'LIC' 85 options = ProductOptionEntry() 86 options.title = u'Base Fee' 87 options.fee = Decimal('800.6') 88 options.currency = 'usd' 89 product.options = [options,] 83 90 self.app['products'][product.product_id] = self.product = product 84 91 self.outfile = os.path.join(self.workdir, 'myoutput.csv') -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_export.py
r12097 r12315 62 62 result = open(self.outfile, 'rb').read() 63 63 self.assertTrue( 64 'contract_category,product_id,title,users_with_local_roles\r\n' 65 'license,LIC,Unnamed,"[{\'user_name\': u\'john\', \'local_role\': ' 64 'contract_category,options,product_id,title,users_with_local_roles\r\n' 65 'license,"[(u\'Base Fee\', u\'800.6\', u\'usd\')]",LIC,Unnamed,' 66 '"[{\'user_name\': u\'john\', \'local_role\': ' 66 67 'u\'johnsrole\'}]"\r\n' 67 68 in result … … 75 76 result = open(self.outfile, 'rb').read() 76 77 self.assertTrue( 77 'contract_category,product_id,title,users_with_local_roles\r\n' 78 'license,LIC,Unnamed,"[{\'user_name\': u\'john\', \'local_role\': ' 78 'contract_category,options,product_id,title,users_with_local_roles\r\n' 79 'license,"[(u\'Base Fee\', u\'800.6\', u\'usd\')]",LIC,Unnamed,' 80 '"[{\'user_name\': u\'john\', \'local_role\': ' 79 81 'u\'johnsrole\'}]"\r\n' 80 82 in result
Note: See TracChangeset for help on using the changeset viewer.