- Timestamp:
- 3 Jan 2015, 07:38:07 (10 years ago)
- Location:
- main/ikobacustom.pcn/trunk
- Files:
-
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
main/ikobacustom.pcn/trunk
-
Property
svn:global-ignores
set to
bin
develop-eggs
parts
sources
var
-
Property
svn:global-ignores
set to
-
main/ikobacustom.pcn/trunk/src
-
Property
svn:global-ignores
set to
ikobacustom.pcn.egg-info
-
Property
svn:global-ignores
set to
-
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_browser.py
r12369 r12371 30 30 from waeup.ikoba.customers.tests.test_batching import CustomerImportExportSetup 31 31 from waeup.ikoba.customers.tests.test_browser import CustomersFullSetup 32 from ikobacustom. skeleton.customers.export import (33 SkeletonCustomerExporter,34 SkeletonCustomerDocumentExporter,35 SkeletonContractExporter)36 from ikobacustom. skeleton.customers.batching import (37 SkeletonCustomerProcessor,38 SkeletonCustomerDocumentProcessor,39 SkeletonContractProcessor)40 from ikobacustom. skeleton.testing import FunctionalLayer, samples_dir32 from ikobacustom.pcn.customers.export import ( 33 PCNCustomerExporter, 34 PCNCustomerDocumentExporter, 35 PCNContractExporter) 36 from ikobacustom.pcn.customers.batching import ( 37 PCNCustomerProcessor, 38 PCNCustomerDocumentProcessor, 39 PCNContractProcessor) 40 from ikobacustom.pcn.testing import FunctionalLayer, samples_dir 41 41 42 42 SAMPLE_IMAGE = os.path.join(os.path.dirname(__file__), 'test_image.jpg') … … 56 56 IWorkflowState(customer).setState('started') 57 57 self.app['customers'].addCustomer(customer) 58 document = createObject(u'waeup. SkeletonCustomerDocument')58 document = createObject(u'waeup.PCNCustomerDocument') 59 59 document.title = u'My first document' 60 60 customer['documents'].addDocument(document) 61 contract = createObject(u'waeup. SkeletonContract')61 contract = createObject(u'waeup.PCNContract') 62 62 contract.tc_dict = {'en':u'Hello World'} 63 63 customer['contracts'].addContract(contract) … … 72 72 # set values we can expect in export file 73 73 self.setup_for_export() 74 exporter = SkeletonCustomerExporter()74 exporter = PCNCustomerExporter() 75 75 exporter.export_all(self.app, self.outfile) 76 76 result = open(self.outfile, 'rb').read() … … 80 80 'K1000000,,Beate,Mueller,,,123,f,0,,,started,[]\r\n') 81 81 # We can reimport the file ... 82 processor = SkeletonCustomerProcessor()82 processor = PCNCustomerProcessor() 83 83 result = processor.doImport( 84 84 self.outfile, … … 112 112 # set values we can expect in export file 113 113 self.setup_for_export() 114 exporter = SkeletonCustomerDocumentExporter()114 exporter = PCNCustomerDocumentExporter() 115 115 exporter.export_all(self.app, self.outfile) 116 116 result = open(self.outfile, 'rb').read() 117 117 self.assertMatches(result, 118 118 'class_name,document_id,history,state,title,user_id\r\n' 119 ' SkeletonCustomerDocument,%s,'119 'PCNCustomerDocument,%s,' 120 120 '[u\'2014-12-21 17:00:36 WAT - Document created by system\'],' 121 121 'created,My first document,K1000000\r\n' 122 122 % self.document.document_id) 123 123 # We can reimport the file if we change the header (user_id -> customer_id) 124 processor = SkeletonCustomerDocumentProcessor()124 processor = PCNCustomerDocumentProcessor() 125 125 open(self.outfile, 'wb').write( 126 126 'customer_id,class_name,document_id,state,title\r\n' 127 'K1000000, SkeletonCustomerDocument,%s,started,My first title\r\n'127 'K1000000,PCNCustomerDocument,%s,started,My first title\r\n' 128 128 % self.document.document_id) 129 129 result = processor.doImport( … … 156 156 # set values we can expect in export file 157 157 self.setup_for_export() 158 exporter = SkeletonContractExporter()158 exporter = PCNContractExporter() 159 159 exporter.export_all(self.app, self.outfile) 160 160 result = open(self.outfile, 'rb').read() … … 163 163 'history,last_product_id,product_object,product_options,' 164 164 'state,tc_dict,title,user_id\r\n' 165 ' SkeletonContract,sample,%s,,'165 'PCNContract,sample,%s,,' 166 166 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 167 167 ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n' 168 168 % self.contract.contract_id) 169 169 # We can reimport the file if we change the header (user_id -> customer_id) 170 processor = SkeletonContractProcessor()170 processor = PCNContractProcessor() 171 171 open(self.outfile, 'wb').write( 172 172 'class_name,contract_category,contract_id,document_object,' 173 173 'history,last_product_id,product_object,product_options,' 174 174 'state,tc_dict,title,user_id\r\n' 175 ' SkeletonContract,sample,%s,,'175 'PCNContract,sample,%s,,' 176 176 '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']' 177 177 ',,,[],created,{\'en\': u\'Hello World\'},,K1000000\r\n' … … 219 219 self.browser.open(self.customer_path + '/documents') 220 220 self.browser.getControl("Add document").click() 221 self.browser.getControl(name="doctype").value = [' SkeletonCustomerDocument']222 self.browser.getControl(name="form.title").value = 'My SkeletonDocument'221 self.browser.getControl(name="doctype").value = ['PCNCustomerDocument'] 222 self.browser.getControl(name="form.title").value = 'My PCN Document' 223 223 self.browser.getControl("Add document").click() 224 224 docid = [i for i in self.customer['documents'].keys() if len(i) > 10][0] -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_contract.py
r12292 r12371 28 28 from waeup.ikoba.customers.contracts import ContractsContainer 29 29 30 from ikobacustom. skeleton.testing import (FunctionalLayer, FunctionalTestCase)31 from ikobacustom. skeleton.customers.contracts import SkeletonContract32 from ikobacustom. skeleton.customers.interfaces import ISkeletonContract30 from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase) 31 from ikobacustom.pcn.customers.contracts import PCNContract 32 from ikobacustom.pcn.customers.interfaces import IPCNContract 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(IPCNContract, PCNContract) 41 verify.verifyClass(ICustomerNavigation, PCNContract) 42 verify.verifyObject(IPCNContract, PCNContract()) 43 verify.verifyObject(ICustomerNavigation, PCNContract()) 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.PCNContract') 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, 'PCNContract') 54 54 return -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_customer.py
r12273 r12371 17 17 ## 18 18 """ 19 Tests for skeleton customers.19 Tests for pcn customers. 20 20 """ 21 21 import tempfile … … 30 30 from waeup.ikoba.customers.container import CustomersContainer 31 31 32 from ikobacustom. skeleton.testing import (FunctionalLayer, FunctionalTestCase)33 from ikobacustom. skeleton.customers.customer import SkeletonCustomer34 from ikobacustom. skeleton.customers.interfaces import ISkeletonCustomer32 from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase) 33 from ikobacustom.pcn.customers.customer import PCNCustomer 34 from ikobacustom.pcn.customers.interfaces import IPCNCustomer 35 35 36 class SkeletonCustomerTestCase(FunctionalTestCase):36 class PCNCustomerTestCase(FunctionalTestCase): 37 37 38 38 layer = FunctionalLayer 39 39 40 40 def setUp(self): 41 super( SkeletonCustomerTestCase, self).setUp()41 super(PCNCustomerTestCase, 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(IPCNCustomer, PCNCustomer) 55 verify.verifyClass(ICustomerNavigation, PCNCustomer) 56 verify.verifyObject(IPCNCustomer, PCNCustomer()) 57 verify.verifyObject(ICustomerNavigation, PCNCustomer()) 58 58 return 59 59 60 def test_add SkeletonCustomer(self):60 def test_addPCNCustomer(self): 61 61 customer = createObject(u'waeup.Customer') 62 verify.verifyObject(I SkeletonCustomer, customer)62 verify.verifyObject(IPCNCustomer, 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(PCNCustomerTestCase, self).tearDown() 71 71 return -
main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/tests/test_document.py
r12292 r12371 28 28 from waeup.ikoba.customers.documents import CustomerDocumentsContainer 29 29 30 from ikobacustom. skeleton.testing import (FunctionalLayer, FunctionalTestCase)31 from ikobacustom. skeleton.customers.documents import SkeletonCustomerDocument32 from ikobacustom. skeleton.customers.interfaces import ISkeletonCustomerDocument30 from ikobacustom.pcn.testing import (FunctionalLayer, FunctionalTestCase) 31 from ikobacustom.pcn.customers.documents import PCNCustomerDocument 32 from ikobacustom.pcn.customers.interfaces import IPCNCustomerDocument 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(IPCNCustomerDocument, PCNCustomerDocument) 41 verify.verifyClass(ICustomerNavigation, PCNCustomerDocument) 42 verify.verifyObject(IPCNCustomerDocument, PCNCustomerDocument()) 43 verify.verifyObject(ICustomerNavigation, PCNCustomerDocument()) 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.PCNCustomerDocument') 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, 'PCNCustomerDocument') 54 54 return
Note: See TracChangeset for help on using the changeset viewer.