Ignore:
Timestamp:
1 Jan 2015, 16:16:55 (10 years ago)
Author:
Henrik Bettermann
Message:

Define product validity period in base package.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba
Files:
6 edited

Legend:

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

    r12342 r12358  
    101101        self.product.title = u'Our Sample Product'
    102102        self.product.contract_category = u'sample'
     103        self.product.valid_from = datetime.date(2015, 12, 4)
    103104        option = ProductOption()
    104105        option.title = u'Base Fee'
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12356 r12358  
    106106        self.product.title = u'Our Sample Product'
    107107        self.product.contract_category = u'sample'
     108        self.product.valid_from = date(2015, 12, 4)
    108109        prodoption = ProductOption()
    109110        prodoption.title = u'First option'
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/interfaces.py

    r12337 r12358  
    2121    IIkobaObject, validate_id,
    2222    ContextualDictSourceFactoryBase)
     23from waeup.ikoba.schema import FormattedDate
    2324from waeup.ikoba.interfaces import MessageFactory as _
    2425from waeup.ikoba.products.productoptions import ProductOptionField
     
    7778        default = [],
    7879        )
     80
     81    valid_from = FormattedDate(
     82        title = _(u'Valid from'),
     83        required = False,
     84        show_year = True,
     85        )
     86
     87    valid_to = FormattedDate(
     88        title = _(u'Valid to'),
     89        required = False,
     90        show_year = True,
     91        )
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_batching.py

    r12342 r12358  
    8888        options.currency = 'USD'
    8989        product.options = [options,]
     90        product.valid_from = datetime.date(2015, 12, 4)
    9091        self.app['products'][product.product_id] = self.product = product
    9192        self.outfile = os.path.join(self.workdir, 'myoutput.csv')
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_browser.py

    r12342 r12358  
    100100            NotIdValue, setattr, self.product, 'product_id', u'id with spaces')
    101101        self.product.title = u'Our License'
     102        self.product.valid_from = date(2015, 12, 4)
    102103        self.app['products'].addProduct(self.product)
    103104
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_export.py

    r12342 r12358  
    6363        self.assertTrue(
    6464            'contract_category,contract_title,options,'
    65             'product_id,title,users_with_local_roles\r\n'
    66             'license,,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",LIC,Unnamed,'
    67             '"[{\'user_name\': u\'john\', \'local_role\': '
     65            'product_id,title,valid_from,valid_to,users_with_local_roles\r\n'
     66            'license,,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",LIC,Unnamed'
     67            ',2015-12-04#,,"[{\'user_name\': u\'john\', \'local_role\': '
    6868            'u\'johnsrole\'}]"\r\n'
    6969            in result
     
    7878        self.assertTrue(
    7979            'contract_category,contract_title,options,'
    80             'product_id,title,users_with_local_roles\r\n'
    81             'license,,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",LIC,Unnamed,'
    82             '"[{\'user_name\': u\'john\', \'local_role\': '
     80            'product_id,title,valid_from,valid_to,users_with_local_roles\r\n'
     81            'license,,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",LIC,Unnamed'
     82            ',2015-12-04#,,"[{\'user_name\': u\'john\', \'local_role\': '
    8383            'u\'johnsrole\'}]"\r\n'
    8484            in result
Note: See TracChangeset for help on using the changeset viewer.