Ignore:
Timestamp:
29 Sep 2016, 06:51:42 (8 years ago)
Author:
Henrik Bettermann
Message:

Fix bug. Customers could also select documents from other customers.

File:
1 edited

Legend:

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

    r12986 r14202  
    154154        contract = createObject('waeup.SampleContract')
    155155        contract.contract_id = u'CON1'
     156        customer['contracts'].addContract(contract)
    156157        contract.product_object = self.product
    157158        contract.document_object = self.document
     
    160161        contract.valid_from = datetime.date(2014, 2, 4)
    161162        contract.valid_to = datetime.date(2014, 12, 4)
    162 
    163         customer['contracts'].addContract(contract)
    164163        self.contract = contract
    165164        return customer
     
    535534    def test_import_update(self):
    536535        # We perform the same import twice,
    537         # the second time in update mode. The number
    538         # of warnings must be the same.
     536        # the second time in update mode. No record can be imported.
    539537        num, num_warns, fin_file, fail_file = self.processor.doImport(
    540538            self.csv_file, CONTRACT_HEADER_FIELDS,'create')
     
    544542        # There are one record without contract_id and two
    545543        # records with wrong object identifier.
    546         self.assertEqual(num_warns,3)
     544        # The other 4 records cannot be imported because DOC1 does
     545        # not belong to these customers.
     546        self.assertEqual(num_warns,7)
    547547        shutil.rmtree(os.path.dirname(fin_file))
    548548
Note: See TracChangeset for help on using the changeset viewer.