Changeset 12536


Ignore:
Timestamp:
1 Feb 2015, 07:30:33 (10 years ago)
Author:
Henrik Bettermann
Message:

If PCN requires a birth certificate, date_of_birth should also be part of IPCNCustomer.

Location:
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12508 r12536  
    5555    """
    5656
     57    date_of_birth = FormattedDate(
     58        title = _(u'Date of Birth'),
     59        required = True,
     60        show_year = True,
     61        )
     62
    5763# Customer document interfaces
    5864
     
    7480
    7581    """
    76 
    77     date_of_birth = FormattedDate(
    78         title = _(u'Date of Birth'),
    79         required = True,
    80         show_year = True,
    81         )
    8282
    8383    state_of_origin = schema.Choice(
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py

    r12534 r12536  
    6262        customer.reg_number = u'123'
    6363        customer.sex = u'f'
     64        customer.date_of_birth = datetime.date(1981, 2, 4)
    6465        IWorkflowState(customer).setState('started')
    6566        self.app['customers'].addCustomer(customer)
     
    9293        result = open(self.outfile, 'rb').read()
    9394        self.assertEqual(result,
    94             'customer_id,email,firstname,lastname,middlename,phone,'
     95            'customer_id,date_of_birth,email,firstname,lastname,middlename,phone,'
    9596            'reg_number,sex,suspended,suspended_comment,password,state,history\r\n'
    96             'K1000000,,Beate,Mueller,,,123,f,0,,,started,[]\r\n')
     97            'K1000000,1981-02-04#,,Beate,Mueller,,,123,f,0,,,started,[]\r\n')
    9798        # We can reimport the file ...
    9899        processor = PCNCustomerProcessor()
    99100        result = processor.doImport(
    100101            self.outfile,
    101             ['customer_id','email','firstname','lastname','middlename','phone',
     102            ['customer_id','date_of_birth','email','firstname','lastname','middlename','phone',
    102103            'reg_number','sex','suspended','suspended_comment','password','state'],
    103104            mode='create')
     
    108109        result = processor.doImport(
    109110            self.outfile,
    110             ['customer_id','email','firstname','lastname','middlename','phone',
     111            ['customer_id','date_of_birth','email','firstname','lastname','middlename','phone',
    111112            'reg_number','sex','suspended','suspended_comment','password','state'],
    112113            mode='create')
     
    116117        result = processor.doImport(
    117118            self.outfile,
    118             ['customer_id','email','firstname','lastname','middlename','phone',
     119            ['customer_id','date_of_birth','email','firstname','lastname','middlename','phone',
    119120            'xx_reg_number','sex','suspended','suspended_comment','password','state'],
    120121            mode='update')
     
    221222        self.assertMatches(result,
    222223            'categories_practice,class_name,comment,contract_category,contract_id,'
    223             'date_of_birth,history,last_product_id,lga,product_object,'
     224            'history,last_product_id,lga,product_object,'
    224225            'product_options,res_address,state,state_of_origin,superintendent,'
    225226            'tc_dict,title,user_id,work_address,work_email,work_phone,'
    226227            'year_qualification\r\n'
    227             '[],RONContract,,ron,%s,,'
     228            '[],RONContract,,ron,%s,'
    228229            '[u\'2015-01-18 16:40:01 WAT - Contract created by system\'],,,,'
    229230            '[],,created,,,{\'en\': u\'Hello World\'},,K1000000,,,,\r\n'
Note: See TracChangeset for help on using the changeset viewer.