- Timestamp:
- 23 Sep 2016, 05:54:20 (8 years ago)
- Location:
- main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_browser.py
r14178 r14181 31 31 from waeup.ikoba.customers.tests.test_browser import CustomersFullSetup 32 32 from ikobacustom.uniben.customers.export import ( 33 SkeletonCustomerExporter,34 SkeletonCustomerDocumentExporter,35 SkeletonContractExporter)33 UnibenCustomerExporter, 34 UnibenCustomerDocumentExporter, 35 UnibenContractExporter) 36 36 from ikobacustom.uniben.customers.batching import ( 37 SkeletonCustomerProcessor,38 SkeletonCustomerDocumentProcessor,39 SkeletonContractProcessor)37 UnibenCustomerProcessor, 38 UnibenCustomerDocumentProcessor, 39 UnibenContractProcessor) 40 40 from ikobacustom.uniben.testing import FunctionalLayer, samples_dir 41 41 … … 61 61 IWorkflowState(customer).setState('started') 62 62 self.app['customers'].addCustomer(customer) 63 document = createObject(u'waeup. SkeletonCustomerDocument')63 document = createObject(u'waeup.UnibenCustomerDocument') 64 64 document.title = u'My first document' 65 65 customer['documents'].addDocument(document) 66 contract = createObject(u'waeup. SkeletonContract')66 contract = createObject(u'waeup.UnibenContract') 67 67 contract.tc_dict = {'en':u'Hello World'} 68 68 customer['contracts'].addContract(contract) … … 77 77 # set values we can expect in export file 78 78 self.setup_for_export() 79 exporter = SkeletonCustomerExporter()79 exporter = UnibenCustomerExporter() 80 80 exporter.export_all(self.app, self.outfile) 81 81 result = open(self.outfile, 'rb').read() … … 85 85 'K1000000,aa@aa.aa,Beate,Mueller,,,123,f,0,,,started,[]\r\n') 86 86 # We can reimport the file ... 87 processor = SkeletonCustomerProcessor()87 processor = UnibenCustomerProcessor() 88 88 result = processor.doImport( 89 89 self.outfile, … … 118 118 # set values we can expect in export file 119 119 self.setup_for_export() 120 exporter = SkeletonCustomerDocumentExporter()120 exporter = UnibenCustomerDocumentExporter() 121 121 exporter.export_all(self.app, self.outfile) 122 122 result = open(self.outfile, 'rb').read() 123 123 self.assertMatches(result, 124 124 'class_name,document_id,history,state,title,user_id\r\n' 125 ' SkeletonCustomerDocument,%s,'125 'UnibenCustomerDocument,%s,' 126 126 '[u\'2014-12-21 17:00:36 WAT - Document created by system\'],' 127 127 'created,My first document,K1000000\r\n' 128 128 % self.document.document_id) 129 129 # We can reimport the file if we change the header (user_id -> customer_id) 130 processor = SkeletonCustomerDocumentProcessor()130 processor = UnibenCustomerDocumentProcessor() 131 131 open(self.outfile, 'wb').write( 132 132 'customer_id,class_name,document_id,state,title\r\n' 133 'K1000000, SkeletonCustomerDocument,%s,started,My first title\r\n'133 'K1000000,UnibenCustomerDocument,%s,started,My first title\r\n' 134 134 % self.document.document_id) 135 135 result = processor.doImport( … … 162 162 # set values we can expect in export file 163 163 self.setup_for_export() 164 exporter = SkeletonContractExporter()164 exporter = UnibenContractExporter() 165 165 exporter.export_all(self.app, self.outfile) 166 166 result = open(self.outfile, 'rb').read() … … 169 169 'fee_based,history,last_product_id,product_object,product_options,' 170 170 'state,tc_dict,title,user_id,valid_from,valid_to\r\n' 171 ' SkeletonContract,,sample,%s,,0,'171 'UnibenContract,,sample,%s,,0,' 172 172 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 173 173 ',,,[],created,{\'en\': u\'Hello World\'},,K1000000,,\r\n' 174 174 % self.contract.contract_id) 175 175 # We can reimport the file if we change the header (user_id -> customer_id) 176 processor = SkeletonContractProcessor()176 processor = UnibenContractProcessor() 177 177 open(self.outfile, 'wb').write( 178 178 'class_name,contract_category,contract_id,document_object,' 179 179 'history,last_product_id,product_object,product_options,' 180 180 'state,tc_dict,title,user_id\r\n' 181 ' SkeletonContract,sample,%s,,'181 'UnibenContract,sample,%s,,' 182 182 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 183 183 ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n' … … 221 221 def setup_customizable_params(self): 222 222 self._contract_category = u'sample' 223 self._document_factory = 'waeup. SkeletonCustomerDocument'224 self._contract_factory = 'waeup. SkeletonContract'223 self._document_factory = 'waeup.UnibenCustomerDocument' 224 self._contract_factory = 'waeup.UnibenContract' 225 225 return 226 226 … … 304 304 def setup_customizable_params(self): 305 305 self._contract_category = u'sample' 306 self._document_factory = 'waeup. SkeletonCustomerDocument'307 self._contract_factory = 'waeup. SkeletonContract'306 self._document_factory = 'waeup.UnibenCustomerDocument' 307 self._contract_factory = 'waeup.UnibenContract' 308 308 return 309 309 -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_contract.py
r14178 r14181 29 29 30 30 from ikobacustom.uniben.testing import (FunctionalLayer, FunctionalTestCase) 31 from ikobacustom.uniben.customers.contracts import SkeletonContract32 from ikobacustom.uniben.customers.interfaces import I SkeletonContract31 from ikobacustom.uniben.customers.contracts import UnibenContract 32 from ikobacustom.uniben.customers.interfaces import IUnibenContract 33 33 34 34 … … 38 38 39 39 def test_interfaces(self): 40 verify.verifyClass(I SkeletonContract, SkeletonContract)41 verify.verifyClass(ICustomerNavigation, SkeletonContract)42 verify.verifyObject(I SkeletonContract, SkeletonContract())43 verify.verifyObject(ICustomerNavigation, SkeletonContract())40 verify.verifyClass(IUnibenContract, UnibenContract) 41 verify.verifyClass(ICustomerNavigation, UnibenContract) 42 verify.verifyObject(IUnibenContract, UnibenContract()) 43 verify.verifyObject(ICustomerNavigation, UnibenContract()) 44 44 return 45 45 46 46 def test_addContract(self): 47 47 container = ContractsContainer() 48 contract = createObject(u'waeup. SkeletonContract')48 contract = createObject(u'waeup.UnibenContract') 49 49 id = contract.contract_id 50 50 container.addContract(contract) 51 51 self.assertEqual(container[id], contract) 52 52 self.assertRaises(TypeError, container.addContract, object()) 53 self.assertEqual(contract.class_name, ' SkeletonContract')53 self.assertEqual(contract.class_name, 'UnibenContract') 54 54 return -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_customer.py
r14178 r14181 31 31 32 32 from ikobacustom.uniben.testing import (FunctionalLayer, FunctionalTestCase) 33 from ikobacustom.uniben.customers.customer import SkeletonCustomer34 from ikobacustom.uniben.customers.interfaces import I SkeletonCustomer33 from ikobacustom.uniben.customers.customer import UnibenCustomer 34 from ikobacustom.uniben.customers.interfaces import IUnibenCustomer 35 35 36 class SkeletonCustomerTestCase(FunctionalTestCase):36 class UnibenCustomerTestCase(FunctionalTestCase): 37 37 38 38 layer = FunctionalLayer 39 39 40 40 def setUp(self): 41 super( SkeletonCustomerTestCase, self).setUp()41 super(UnibenCustomerTestCase, self).setUp() 42 42 43 43 # Prepopulate ZODB … … 52 52 53 53 def test_interfaces(self): 54 verify.verifyClass(I SkeletonCustomer, SkeletonCustomer)55 verify.verifyClass(ICustomerNavigation, SkeletonCustomer)56 verify.verifyObject(I SkeletonCustomer, SkeletonCustomer())57 verify.verifyObject(ICustomerNavigation, SkeletonCustomer())54 verify.verifyClass(IUnibenCustomer, UnibenCustomer) 55 verify.verifyClass(ICustomerNavigation, UnibenCustomer) 56 verify.verifyObject(IUnibenCustomer, UnibenCustomer()) 57 verify.verifyObject(ICustomerNavigation, UnibenCustomer()) 58 58 return 59 59 60 def test_add SkeletonCustomer(self):60 def test_addUnibenCustomer(self): 61 61 customer = createObject(u'waeup.Customer') 62 verify.verifyObject(I SkeletonCustomer, customer)62 verify.verifyObject(IUnibenCustomer, customer) 63 63 self.app['customers'].addCustomer(customer) 64 64 self.assertEqual(customer.customer_id, 'K1000000') … … 68 68 def tearDown(self): 69 69 shutil.rmtree(self.dc_root) 70 super( SkeletonCustomerTestCase, self).tearDown()70 super(UnibenCustomerTestCase, self).tearDown() 71 71 return -
main/ikobacustom.uniben/trunk/src/ikobacustom/uniben/customers/tests/test_document.py
r14178 r14181 29 29 30 30 from ikobacustom.uniben.testing import (FunctionalLayer, FunctionalTestCase) 31 from ikobacustom.uniben.customers.documents import SkeletonCustomerDocument32 from ikobacustom.uniben.customers.interfaces import I SkeletonCustomerDocument31 from ikobacustom.uniben.customers.documents import UnibenCustomerDocument 32 from ikobacustom.uniben.customers.interfaces import IUnibenCustomerDocument 33 33 34 34 … … 38 38 39 39 def test_interfaces(self): 40 verify.verifyClass(I SkeletonCustomerDocument, SkeletonCustomerDocument)41 verify.verifyClass(ICustomerNavigation, SkeletonCustomerDocument)42 verify.verifyObject(I SkeletonCustomerDocument, SkeletonCustomerDocument())43 verify.verifyObject(ICustomerNavigation, SkeletonCustomerDocument())40 verify.verifyClass(IUnibenCustomerDocument, UnibenCustomerDocument) 41 verify.verifyClass(ICustomerNavigation, UnibenCustomerDocument) 42 verify.verifyObject(IUnibenCustomerDocument, UnibenCustomerDocument()) 43 verify.verifyObject(ICustomerNavigation, UnibenCustomerDocument()) 44 44 return 45 45 46 46 def test_addDocument(self): 47 47 container = CustomerDocumentsContainer() 48 document = createObject(u'waeup. SkeletonCustomerDocument')48 document = createObject(u'waeup.UnibenCustomerDocument') 49 49 id = document.document_id 50 50 container.addDocument(document) 51 51 self.assertEqual(container[id], document) 52 52 self.assertRaises(TypeError, container.addDocument, object()) 53 self.assertEqual(document.class_name, ' SkeletonCustomerDocument')53 self.assertEqual(document.class_name, 'UnibenCustomerDocument') 54 54 return
Note: See TracChangeset for help on using the changeset viewer.