Changeset 14188


Ignore:
Timestamp:
26 Sep 2016, 05:13:42 (8 years ago)
Author:
Henrik Bettermann
Message:

Extend contract interface.

Location:
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers
Files:
3 edited

Legend:

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

    r14184 r14188  
    5252    """
    5353
    54     document_object = schema.Choice(
    55         title = _(u'Document'),
    56         source = CustomerDocumentSource(),
    57         required = False,
    58         )
    59 
    60     document_object2 = schema.Choice(
    61         title = _(u'Document 2'),
     54    doc1 = schema.Choice(
     55        title = _(u'Biographical Citation'),
     56        source = CustomerDocumentSource(),
     57        required = False,
     58        )
     59
     60    doc2 = schema.Choice(
     61        title = _(u'Supporting Statement'),
     62        source = CustomerDocumentSource(),
     63        required = False,
     64        )
     65
     66    doc3 = schema.Choice(
     67        title = _(u'Narrative Write-Up'),
     68        source = CustomerDocumentSource(),
     69        required = False,
     70        )
     71
     72    doc4 = schema.Choice(
     73        title = _(u'Itemized Statement'),
     74        source = CustomerDocumentSource(),
     75        required = False,
     76        )
     77
     78    doc5 = schema.Choice(
     79        title = _(u'Significant Publivations'),
     80        source = CustomerDocumentSource(),
     81        required = False,
     82        )
     83
     84    doc6 = schema.Choice(
     85        title = _(u'Curriculum Vitae'),
     86        source = CustomerDocumentSource(),
     87        required = False,
     88        )
     89
     90    doc7 = schema.Choice(
     91        title = _(u'Previous Awards'),
     92        source = CustomerDocumentSource(),
     93        required = False,
     94        )
     95
     96    doc8 = schema.Choice(
     97        title = _(u'Leadership Roles'),
     98        source = CustomerDocumentSource(),
     99        required = False,
     100        )
     101
     102    doc9 = schema.Choice(
     103        title = _(u'Photos and Illustrations'),
     104        source = CustomerDocumentSource(),
     105        required = False,
     106        )
     107
     108
     109    doc10 = schema.Choice(
     110        title = _(u'State of H-Index'),
     111        source = CustomerDocumentSource(),
     112        required = False,
     113        )
     114
     115    doc11 = schema.Choice(
     116        title = _(u'Reference Letters'),
    62117        source = CustomerDocumentSource(),
    63118        required = False,
     
    97152    """
    98153
    99     document_object = schema.Choice(
    100         title = _(u'Document'),
    101         source = CustomerDocumentSource(),
    102         required = True,
    103         )
    104 
    105     document_object2 = schema.Choice(
    106         title = _(u'Document 2'),
    107         source = CustomerDocumentSource(),
    108         required = True,
    109         )
     154    doc1 = schema.Choice(
     155        title = _(u'Biographical Citation'),
     156        source = CustomerDocumentSource(),
     157        required = True,
     158        )
     159
     160    doc2 = schema.Choice(
     161        title = _(u'Supporting Statement'),
     162        source = CustomerDocumentSource(),
     163        required = True,
     164        )
     165
     166    doc3 = schema.Choice(
     167        title = _(u'Narrative Write-Up'),
     168        source = CustomerDocumentSource(),
     169        required = True,
     170        )
     171
     172    doc4 = schema.Choice(
     173        title = _(u'Itemized Statement'),
     174        source = CustomerDocumentSource(),
     175        required = True,
     176        )
     177
     178    doc5 = schema.Choice(
     179        title = _(u'Significant Publivations'),
     180        source = CustomerDocumentSource(),
     181        required = True,
     182        )
     183
     184    doc6 = schema.Choice(
     185        title = _(u'Curriculum Vitae'),
     186        source = CustomerDocumentSource(),
     187        required = True,
     188        )
     189
     190    doc7 = schema.Choice(
     191        title = _(u'Previous Awards'),
     192        source = CustomerDocumentSource(),
     193        required = True,
     194        )
     195
     196    doc8 = schema.Choice(
     197        title = _(u'Leadership Roles'),
     198        source = CustomerDocumentSource(),
     199        required = True,
     200        )
     201
     202    doc9 = schema.Choice(
     203        title = _(u'Photos and Illustrations'),
     204        source = CustomerDocumentSource(),
     205        required = True,
     206        )
     207
     208
     209    doc10 = schema.Choice(
     210        title = _(u'State of H-Index'),
     211        source = CustomerDocumentSource(),
     212        required = True,
     213        )
     214
     215    doc11 = schema.Choice(
     216        title = _(u'Reference Letters'),
     217        source = CustomerDocumentSource(),
     218        required = True,
     219        )
  • main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_browser.py

    r14184 r14188  
    3232from ikobacustom.uniben.customers.export import (
    3333    UnibenCustomerExporter,
    34     UnibenCustomerDocumentExporter,
     34    UnibenCustomerPDFDocumentExporter,
    3535    RIAAContractExporter)
    3636from ikobacustom.uniben.customers.batching import (
    3737    UnibenCustomerProcessor,
    38     UnibenCustomerDocumentProcessor,
     38    UnibenCustomerPDFDocumentProcessor,
    3939    RIAAContractProcessor)
    4040from ikobacustom.uniben.testing import FunctionalLayer, samples_dir
     
    6161        IWorkflowState(customer).setState('started')
    6262        self.app['customers'].addCustomer(customer)
    63         document = createObject(u'waeup.UnibenCustomerDocument')
     63        document = createObject(u'waeup.UnibenCustomerPDFDocument')
    6464        document.title = u'My first document'
    6565        customer['documents'].addDocument(document)
     
    8383            'customer_id,email,firstname,lastname,middlename,phone,'
    8484            'reg_number,sex,suspended,suspended_comment,password,state,history\r\n'
    85             'K1000000,aa@aa.aa,Beate,Mueller,,,123,f,0,,,started,[]\r\n')
     85            'B1000000,aa@aa.aa,Beate,Mueller,,,123,f,0,,,started,[]\r\n')
    8686        # We can reimport the file ...
    8787        processor = UnibenCustomerProcessor()
     
    9494        self.assertEqual(num_fail,1)
    9595        # ... if we remove the original customer.
    96         del self.app['customers']['K1000000']
     96        del self.app['customers']['B1000000']
    9797        result = processor.doImport(
    9898            self.outfile,
     
    118118        # set values we can expect in export file
    119119        self.setup_for_export()
    120         exporter = UnibenCustomerDocumentExporter()
     120        exporter = UnibenCustomerPDFDocumentExporter()
    121121        exporter.export_all(self.app, self.outfile)
    122122        result = open(self.outfile, 'rb').read()
    123123        self.assertMatches(result,
    124124            'class_name,document_id,history,state,title,user_id\r\n'
    125             'UnibenCustomerDocument,%s,'
     125            'UnibenCustomerPDFDocument,%s,'
    126126            '[u\'2014-12-21 17:00:36 WAT - Document created by system\'],'
    127             'created,My first document,K1000000\r\n'
     127            'created,My first document,B1000000\r\n'
    128128            % self.document.document_id)
    129129        # We can reimport the file if we change the header (user_id -> customer_id)
    130         processor = UnibenCustomerDocumentProcessor()
     130        processor = UnibenCustomerPDFDocumentProcessor()
    131131        open(self.outfile, 'wb').write(
    132132            'customer_id,class_name,document_id,state,title\r\n'
    133             'K1000000,UnibenCustomerDocument,%s,started,My first title\r\n'
     133            'B1000000,UnibenCustomerPDFDocument,%s,started,My first title\r\n'
    134134            % self.document.document_id)
    135135        result = processor.doImport(
     
    166166        result = open(self.outfile, 'rb').read()
    167167        self.assertMatches(result,
    168             'class_name,comment,contract_category,contract_id,document_object,'
     168            'class_name,comment,contract_category,contract_id,'
     169            'doc1,doc10,doc11,doc2,doc3,doc4,doc5,doc6,doc7,doc8,doc9,'
    169170            'fee_based,history,last_product_id,product_object,product_options,'
    170171            'state,tc_dict,title,user_id,valid_from,valid_to\r\n'
    171             'RIAAContract,,riaa,%s,,0,'
     172            'RIAAContract,,riaa,%s,,,,,,,,,,,,0,'
    172173            '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
    173             ',,,[],created,{\'en\': u\'Hello World\'},,K1000000,,\r\n'
     174            ',,,[],created,{\'en\': u\'Hello World\'},,B1000000,,\r\n'
    174175            % self.contract.contract_id)
    175176        # We can reimport the file if we change the header (user_id -> customer_id)
     
    181182            'RIAAContract,riaa,%s,,'
    182183            '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
    183             ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n'
     184            ',,,[],created,{\'en\': u\'Hello World\'},,B1000000\r\n'
    184185            % self.contract.contract_id)
    185186        result = processor.doImport(
     
    238239        self.browser.getControl("Save").click() # submit form
    239240        self.assertFalse(
    240             'href="http://localhost/app/customers/K1000000/documents/DOC1/sample"'
     241            'href="http://localhost/app/customers/B1000000/documents/DOC1/sample"'
    241242            in self.browser.contents)
    242243        # ... but the correct upload submit button does
     
    248249            name='upload_samplescanmanageupload').click()
    249250        self.assertTrue(
    250             'href="http://localhost/app/customers/K1000000/documents/DOC1/sample"'
     251            'href="http://localhost/app/customers/B1000000/documents/DOC1/sample"'
    251252            in self.browser.contents)
    252253        # Browsing the link shows a real image
  • main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_customer.py

    r14181 r14188  
    6262        verify.verifyObject(IUnibenCustomer, customer)
    6363        self.app['customers'].addCustomer(customer)
    64         self.assertEqual(customer.customer_id, 'K1000000')
    65         self.assertEqual(self.app['customers']['K1000000'], customer)
     64        self.assertEqual(customer.customer_id, 'B1000000')
     65        self.assertEqual(self.app['customers']['B1000000'], customer)
    6666        return
    6767
Note: See TracChangeset for help on using the changeset viewer.