Ignore:
Timestamp:
25 Nov 2014, 08:19:54 (10 years ago)
Author:
Henrik Bettermann
Message:

Add second customer document class.
Select document factory when adding documents.
Add last_transition_date attribute and further property attributes to documents.

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/test_browser.py

    r12051 r12053  
    812812        self.browser.getLink("Documents").click()
    813813        self.browser.getLink("Add document").click()
    814         self.browser.getControl(name="doctype").value = ['sample']
     814        self.browser.getControl(name="doctype").value = ['CustomerPDFDocument']
    815815        self.browser.getControl("Create document").click()
    816         self.assertTrue('Sample Document created.' in self.browser.contents)
     816        self.assertTrue('PDF Document created.' in self.browser.contents)
    817817        document = self.customer['documents']['d102']
    818818
     
    853853        self.assertTrue(
    854854            'INFO - zope.mgr - customers.browser.DocumentAddFormPage '
    855             '- K1000000 - added: Sample Document %s'
     855            '- K1000000 - added: PDF Document %s'
    856856            % document.document_id in logcontent)
    857857
     
    871871        self.browser.getLink("Documents").click()
    872872        self.browser.getLink("Add document").click()
    873         self.browser.getControl(name="doctype").value = ['sample']
     873        self.browser.getControl(name="doctype").value = ['CustomerDocument']
    874874        self.browser.getControl("Create document").click()
    875875        self.assertTrue('Sample Document created.' in self.browser.contents)
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_document.py

    r12004 r12053  
    6161        self.assertEqual(container[id], document)
    6262        self.assertRaises(TypeError, container.addDocument, object())
     63        self.assertEqual(document.classname, 'CustomerDocument')
    6364        return
    6465
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_export.py

    r12017 r12053  
    138138        self.assertEqual(
    139139            result,
    140             'document_id,history,state,title,customer_id\r\n'
    141             'd101,[],,,\r\n'
     140            'classname,document_id,history,last_transition_date,state,title,customer_id\r\n'
     141            'CustomerDocument,d101,[],,,,\r\n'
    142142            )
    143143        return
     
    152152        result = open(self.outfile, 'rb').read()
    153153        self.assertTrue(
    154             'document_id,history,state,title,customer_id\r\n'
     154            'classname,document_id,history,last_transition_date,state,title,customer_id\r\n'
    155155            in result
    156156            )
    157         self.assertTrue(
    158             'Document created by system\'],created,My Document,A111111\r\n'
    159             in result
     157        self.assertMatches(
     158            '...CustomerDocument,d101,[u\'2014-11-25 06:57:24 UTC - '
     159            'Document created by system\'],2014-11-25 06:57:24.990308#,'
     160            'created,My Document,A111111...',
     161            result
    160162            )
    161163        return
     
    169171        result = open(self.outfile, 'rb').read()
    170172        self.assertTrue(
    171             'document_id,history,state,title,customer_id\r\n'
     173            'classname,document_id,history,last_transition_date,state,title,customer_id\r\n'
    172174            in result)
    173         self.assertTrue(
    174             ' Document created by system\'],created,My Document,A111111\r\n'
    175             in result)
     175        self.assertMatches(
     176            '...CustomerDocument,d101,[u\'2014-11-25 06:57:24 UTC - '
     177            'Document created by system\'],2014-11-25 06:57:24.990308#,'
     178            'created,My Document,A111111...',
     179            result
     180            )
    176181        return
    177182
     
    184189        result = open(self.outfile, 'rb').read()
    185190        self.assertTrue(
    186             'document_id,history,state,title,customer_id\r\n'
     191            'classname,document_id,history,last_transition_date,state,title,customer_id\r\n'
    187192            in result)
    188         self.assertTrue(
    189             ' Document created by system\'],created,My Document,A111111\r\n'
    190             in result)
     193        self.assertMatches(
     194            '...CustomerDocument,d101,[u\'2014-11-25 06:57:24 UTC - '
     195            'Document created by system\'],2014-11-25 06:57:24.990308#,'
     196            'created,My Document,A111111...',
     197            result
     198            )
    191199        return
Note: See TracChangeset for help on using the changeset viewer.