Changeset 310

Show
Ignore:
Timestamp:
09/21/06 16:27:03 (2 years ago)
Author:
thomase
Message:

Fixed messes created when custom code hooks got blown away by first agx-regeneration with new content package. Also added rudimentary tests to verify presence of fields.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • GeographicEntityLite/trunk/GeographicEntityLite/content/GeographicEntityLite.py

    r302 r310  
    4242 
    4343##code-section module-header #fill in your manual code here 
     44from Products.GeographicEntityLite.Extensions.cooking import * 
    4445##/code-section module-header 
    4546 
     
    152153 
    153154    # Methods 
     155    security.declarePrivate('at_post_edit_script') 
     156    def at_post_edit_script(self): 
     157        newID = setIDFromTitle(self) 
     158 
     159    security.declarePrivate('at_post_create_script') 
     160    def at_post_create_script(self): 
     161        self.at_post_edit_script() 
    154162 
    155163registerType(GeographicEntityLite, PROJECTNAME) 
  • GeographicEntityLite/trunk/GeographicEntityLite/content/GeographicNameLite.py

    r302 r310  
    4242 
    4343##code-section module-header #fill in your manual code here 
     44from Products.GeographicEntityLite.Extensions.cooking import * 
    4445##/code-section module-header 
    4546 
     
    148149 
    149150    ##code-section class-header #fill in your manual code here 
     151    schema['title'].widget.label = 'Transliterated Name' 
    150152    ##/code-section class-header 
    151153 
    152154    # Methods 
    153  
     155    security.declarePrivate('at_post_edit_script') 
     156    def at_post_edit_script(self): 
     157        newID = setIDFromTitle(self) 
     158         
     159    security.declarePrivate('at_post_create_script') 
     160    def at_post_create_script(self): 
     161        self.at_post_edit_script() 
     162         
    154163registerType(GeographicNameLite, PROJECTNAME) 
    155164# end of class GeographicNameLite 
  • GeographicEntityLite/trunk/GeographicEntityLite/tests/GeoEntityLite.txt

    r306 r310  
    2222    >>> entity.portal_type 
    2323    'GeographicEntityLite' 
     24    >>> entity.invokeFactory('GeographicNameLite', id='bbb') 
     25    'bbb' 
     26    >>> namity = entity.bbb 
     27    >>> namity.id 
     28    'bbb' 
     29    >>> namity.portal_type 
     30    'GeographicNameLite' 
    2431     
    2532Initialize the test browser 
     
    4956     
    5057Check the html content of the view page (description will not appear here) 
     58     
     59    >>> browser.contents 
     60    '...Identifier...' 
     61     
     62    >>> browser.contents 
     63    '...Entity Type...' 
     64         
     65    >>> browser.contents 
     66    '...Modern Name / Location...' 
     67 
     68 
     69    >>> browser.contents 
     70    '...Time Periods...' 
     71 
     72    >>> browser.contents 
     73    '...Secondary References...' 
     74 
     75    >>> browser.contents 
     76    '...Spatial Coordinates...' 
     77 
     78    >>> browser.contents 
     79    '...Spatial Geometry Type...' 
     80 
    5181    >>> browser.contents 
    5282    '...Historical Names...' 
     83     
     84    >>> link = browser.getLink('bbb') 
     85    >>> link.click() 
     86     
     87    >>> namity_url = namity.absolute_url() 
     88    >>> browser.url == namity_url + '/' 
     89    True 
     90     
     91    >>> browser.contents 
     92    '...Identifier...' 
     93     
     94    >>> browser.contents 
     95    '...Name Type...' 
     96     
     97    >>> browser.contents 
     98    '...Name as Attested...' 
     99     
     100    >>> browser.contents 
     101    '...Language and Writing System of Attested Name...' 
     102     
     103    >>> browser.contents 
     104    '...Time Periods...' 
     105     
     106    >>> browser.contents 
     107    '...Primary References...' 
     108     
     109    >>> browser.contents 
     110    '...Secondary References...' 
     111     
     112