Ignore:
Timestamp:
20 Nov 2014, 04:11:18 (10 years ago)
Author:
Henrik Bettermann
Message:

Replace 'id' by 'document_id'.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/sample_document_data.csv

    r11995 r12004  
    1 id,reg_number,title
     1document_id,reg_number,title
    22d1266236341953,1,My first doc
    33d1266236341954,2,My second doc
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py

    r11997 r12004  
    11# -*- coding: utf-8 -*-
    2 ## $Id: test_batching.py 11756 2014-07-09 12:46:08Z henrik $
     2## $Id$
    33##
    44## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann
     
    259259        self.customer = self.app['customers'][customer.customer_id]
    260260        document = createObject(u'waeup.CustomerDocument')
    261         document.id = 'd120'
    262         self.customer['documents'][document.id] = document
     261        document.document_id = 'd120'
     262        self.customer['documents'][document.document_id] = document
    263263
    264264        # Import customers with subobjects
     
    282282    def test_getEntry(self):
    283283        assert self.processor.getEntry(
    284             dict(customer_id='ID_NONE', id='nonsense'), self.app) is None
    285         assert self.processor.getEntry(
    286             dict(customer_id=self.customer.customer_id, id='d120'),
     284            dict(customer_id='ID_NONE', document_id='nonsense'), self.app) is None
     285        assert self.processor.getEntry(
     286            dict(customer_id=self.customer.customer_id, document_id='d120'),
    287287            self.app) is self.customer['documents']['d120']
    288288
    289289    def test_delEntry(self):
    290290        assert self.processor.getEntry(
    291             dict(customer_id=self.customer.customer_id, id='d120'),
     291            dict(customer_id=self.customer.customer_id, document_id='d120'),
    292292            self.app) is self.customer['documents']['d120']
    293293        self.assertEqual(len(self.customer['documents'].keys()),1)
    294294        self.processor.delEntry(
    295             dict(customer_id=self.customer.customer_id, id='d120'),
     295            dict(customer_id=self.customer.customer_id, document_id='d120'),
    296296            self.app)
    297297        assert self.processor.getEntry(
    298             dict(customer_id=self.customer.customer_id, id='d120'),
     298            dict(customer_id=self.customer.customer_id, document_id='d120'),
    299299            self.app) is None
    300300        self.assertEqual(len(self.customer['documents'].keys()),0)
     
    303303        self.assertEqual(len(self.customer['documents'].keys()),1)
    304304        document1 = createObject(u'waeup.CustomerDocument')
    305         document1.id = 'p234'
     305        document1.document_id = 'p234'
    306306        self.processor.addEntry(
    307             document1, dict(customer_id=self.customer.customer_id, id='p234'),
     307            document1, dict(customer_id=self.customer.customer_id, document_id='p234'),
    308308            self.app)
    309309        self.assertEqual(len(self.customer['documents'].keys()),2)
    310         self.assertEqual(self.customer['documents']['p234'].id, 'p234')
     310        self.assertEqual(self.customer['documents']['p234'].document_id, 'p234')
    311311        document2 = createObject(u'waeup.CustomerDocument')
    312         document1.id = 'nonsense'
     312        document1.document_id = 'nonsense'
    313313
    314314    def test_checkConversion(self):
    315315        errs, inv_errs, conv_dict = self.processor.checkConversion(
    316             dict(id='d1266236341955'))
     316            dict(document_id='d1266236341955'))
    317317        self.assertEqual(len(errs),0)
    318318        errs, inv_errs, conv_dict = self.processor.checkConversion(
    319             dict(id='nonsense'))
     319            dict(document_id='nonsense'))
    320320        self.assertEqual(len(errs),1)
    321321        timestamp = ("%d" % int(time()*10000))[1:]
    322         id = "d%s" % timestamp
    323         errs, inv_errs, conv_dict = self.processor.checkConversion(
    324             dict(id=id))
     322        document_id = "d%s" % timestamp
     323        errs, inv_errs, conv_dict = self.processor.checkConversion(
     324            dict(document_id=document_id))
    325325        self.assertEqual(len(errs),0)
    326326
     
    330330        self.assertEqual(num_warns,0)
    331331        document = self.processor.getEntry(dict(reg_number='1',
    332             id='d1266236341953'), self.app)
     332            document_id='d1266236341953'), self.app)
    333333        self.assertEqual(
    334334            self.app['customers']['X666666']['documents']['d1266236341953'],
    335335            document)
    336         self.assertEqual(document.id, 'd1266236341953')
     336        self.assertEqual(document.document_id, 'd1266236341953')
    337337        document = self.processor.getEntry(dict(reg_number='3',
    338             id='d1266236341955'), self.app)
     338            document_id='d1266236341955'), self.app)
    339339        shutil.rmtree(os.path.dirname(fin_file))
    340340        logcontent = open(self.logfile).read()
     
    343343            'INFO - system - CustomerDocument Processor - '
    344344            'sample_document_data - X666666 - updated: '
    345             'id=d1266236341953, title=My first doc'
     345            'document_id=d1266236341953, title=My first doc'
    346346            in logcontent)
    347347
     
    355355        num, num_warns, fin_file, fail_file = self.processor.doImport(
    356356            self.csv_file, DOCUMENT_HEADER_FIELDS,'update')
    357         self.assertEqual(num_warns,1)  # There is one record without id
     357        self.assertEqual(num_warns,1)  # There is one record without document_id
    358358        shutil.rmtree(os.path.dirname(fin_file))
    359359
     
    367367        num, num_warns, fin_file, fail_file = self.processor.doImport(
    368368            self.csv_file, DOCUMENT_HEADER_FIELDS,'remove')
    369         self.assertEqual(num_warns,1)  # There is one record without id
     369        self.assertEqual(num_warns,1)  # There is one record without document_id
    370370        shutil.rmtree(os.path.dirname(fin_file))
    371371        logcontent = open(self.logfile).read()
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_document.py

    r11997 r12004  
    1 ## $Id: tests.py 9469 2012-10-30 17:49:17Z henrik $
     1## $Id$
    22##
    33## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann
     
    5757        container = CustomerDocumentsContainer()
    5858        document = createObject(u'waeup.CustomerDocument')
    59         document.id = 'my_document'
     59        id = document.document_id
    6060        container.addDocument(document)
    61         self.assertEqual(container['my_document'], document)
     61        self.assertEqual(container[id], document)
    6262        self.assertRaises(TypeError, container.addDocument, object())
    6363        return
Note: See TracChangeset for help on using the changeset viewer.