Ignore:
Timestamp:
5 Jan 2015, 07:45:40 (10 years ago)
Author:
Henrik Bettermann
Message:

Rename PCNContract to emphasize that this contract deelas with licenses only.

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

Legend:

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

    r12390 r12401  
    3434    PCNCustomerPDFDocumentExporter,
    3535    PCNCustomerJPGDocumentExporter,
    36     PCNContractExporter)
     36    PCNLicenseContractExporter)
    3737from ikobacustom.pcn.customers.batching import (
    3838    PCNCustomerProcessor,
    3939    PCNCustomerPDFDocumentProcessor,
    4040    PCNCustomerJPGDocumentProcessor,
    41     PCNContractProcessor)
     41    PCNLicenseContractProcessor)
    4242from ikobacustom.pcn.testing import FunctionalLayer, samples_dir
    4343
     
    6868        customer['documents'].addDocument(document1)
    6969        customer['documents'].addDocument(document2)
    70         contract = createObject(u'waeup.PCNContract')
     70        contract = createObject(u'waeup.PCNLicenseContract')
    7171        contract.tc_dict = {'en':u'Hello World'}
    7272        customer['contracts'].addContract(contract)
     
    210210        # set values we can expect in export file
    211211        self.setup_for_export()
    212         exporter = PCNContractExporter()
     212        exporter = PCNLicenseContractExporter()
    213213        exporter.export_all(self.app, self.outfile)
    214214        result = open(self.outfile, 'rb').read()
     
    217217            'history,last_product_id,product_object,product_options,'
    218218            'state,tc_dict,title,user_id\r\n'
    219             'PCNContract,license,%s,,'
     219            'PCNLicenseContract,license,%s,,'
    220220            '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
    221221            ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n'
    222222            % self.contract.contract_id)
    223223        # We can reimport the file if we change the header (user_id -> customer_id)
    224         processor = PCNContractProcessor()
     224        processor = PCNLicenseContractProcessor()
    225225        open(self.outfile, 'wb').write(
    226226            'class_name,contract_category,contract_id,document_object,'
    227227            'history,last_product_id,product_object,product_options,'
    228228            'state,tc_dict,title,user_id\r\n'
    229             'PCNContract,license,%s,,'
     229            'PCNLicenseContract,license,%s,,'
    230230            '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
    231231            ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n'
     
    270270        self._contract_category = u'license'
    271271        self._document_factory = 'waeup.PCNCustomerPDFDocument'
    272         self._contract_factory = 'waeup.PCNContract'
     272        self._contract_factory = 'waeup.PCNLicenseContract'
    273273        return
    274274
     
    322322        self._contract_category = u'license'
    323323        self._document_factory = 'waeup.PCNCustomerPDFDocument'
    324         self._contract_factory = 'waeup.PCNContract'
     324        self._contract_factory = 'waeup.PCNLicenseContract'
    325325        return
    326326
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py

    r12371 r12401  
    2929
    3030from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase)
    31 from ikobacustom.pcn.customers.contracts import PCNContract
    32 from ikobacustom.pcn.customers.interfaces import IPCNContract
     31from ikobacustom.pcn.customers.contracts import PCNLicenseContract
     32from ikobacustom.pcn.customers.interfaces import IPCNLicenseContract
    3333
    3434
     
    3838
    3939    def test_interfaces(self):
    40         verify.verifyClass(IPCNContract, PCNContract)
    41         verify.verifyClass(ICustomerNavigation, PCNContract)
    42         verify.verifyObject(IPCNContract, PCNContract())
    43         verify.verifyObject(ICustomerNavigation, PCNContract())
     40        verify.verifyClass(IPCNLicenseContract, PCNLicenseContract)
     41        verify.verifyClass(ICustomerNavigation, PCNLicenseContract)
     42        verify.verifyObject(IPCNLicenseContract, PCNLicenseContract())
     43        verify.verifyObject(ICustomerNavigation, PCNLicenseContract())
    4444        return
    4545
    4646    def test_addContract(self):
    4747        container = ContractsContainer()
    48         contract = createObject(u'waeup.PCNContract')
     48        contract = createObject(u'waeup.PCNLicenseContract')
    4949        id = contract.contract_id
    5050        container.addContract(contract)
    5151        self.assertEqual(container[id], contract)
    5252        self.assertRaises(TypeError, container.addContract, object())
    53         self.assertEqual(contract.class_name, 'PCNContract')
     53        self.assertEqual(contract.class_name, 'PCNLicenseContract')
    5454        return
Note: See TracChangeset for help on using the changeset viewer.