Ignore:
Timestamp:
May 18, 2012 10:55:47 AM (12 years ago)
Author:
kroman0
Message:

Fixed tests for plone 42 and pyflakes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.analytics/trunk/quintagroup/analytics/tests.py

    r3380 r3465  
    174174                                 name="ownership_by_type") 
    175175        self.pc = self.portal.portal_catalog 
     176        portal_migration = self.portal.portal_migration 
     177        version = portal_migration.getFileSystemVersion() 
     178        self.plone_version = version.replace(".", "") 
    176179 
    177180    def test_getUsers(self): 
     
    246249            'chtt=Content+ownership+by+type&chdl=Folder|Document|'\ 
    247250            'Event|Topic&chdlp=b" />' 
    248         chart_tag = plone4chart_tag 
    249         if not PLONE40: 
     251        plone42chart_tag = \ 
     252            '<img src="http://chart.apis.google.com/chart?chxt=y&amp;'\ 
     253            'chds=0,57&amp;chd=t:19.0,18.0,17.0,16.0,15.0,14.0,'\ 
     254            '13.0,12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,'\ 
     255            '12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,'\ 
     256            '11.0,10.0|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0&amp;'\ 
     257            'chxr=0,0,57&amp;chco=669933,cc9966,993300,ff6633,e8e4e3,'\ 
     258            'a9a486,dcb57e,ffcc99,996633,333300,00ff00&amp;chl=user9|'\ 
     259            'user8|user7|user6|user5|user4|user3|user2|user1|user0&amp;'\ 
     260            'chbh=a,10,0&amp;chs=800x375&amp;cht=bvs&amp;'\ 
     261            'chtt=Content+ownership+by+type&amp;chdl=Folder|Document|'\ 
     262            'Event|Collection&amp;chdlp=b"/>'             
     263 
     264        if self.plone_version < "40": 
    250265            chart_tag = plone33chart_tag 
     266        elif self.plone_version > "42": 
     267            chart_tag = plone42chart_tag 
     268        else: 
     269            chart_tag = plone4chart_tag 
    251270 
    252271        self.loginAsPortalOwner() 
     
    396415            'vs&amp;chtt=Content+type+by+state&amp;chdl=private|published|N'\ 
    397416            'o+workflow&amp;chdlp=b"/>' 
     417        plone42chart_tag = \ 
     418            '<imgsrc="http://chart.apis.google.com/chart?chxt=y&amp;chds=0,'\ 
     419            '159&amp;chd=t:156.0,145.0,145.0,0.0|3.0,1.0,0.0,2.0|0.0,0.0,0.'\ 
     420            '0,0.0&amp;chxr=0,0,159&amp;chco=669933,cc9966,993300,ff6633,e8'\ 
     421            'e4e3,a9a486,dcb57e,ffcc99,996633,333300,00ff00&amp;chl=Folder|'\ 
     422            'Document|Event|Collection&amp;chbh=a,10,0&amp;chs=800x375&amp;'\ 
     423            'cht=bvs&amp;chtt=Content+type+by+state&amp;chdl=private|publis'\ 
     424            'hed|No+workflow&amp;chdlp=b"/>' 
    398425 
    399426        if self.plone_version < "40": 
    400427            chart_tag = plone33chart_tag 
    401         elif self.plone_version > "41": 
     428        elif self.plone_version > "40" and self.plone_version < "41": 
     429            chart_tag = plone4chart_tag 
     430        elif self.plone_version > "41" and self.plone_version < "42": 
    402431            chart_tag = plone41chart_tag 
    403         else: 
    404             chart_tag = plone4chart_tag 
     432        elif self.plone_version > "42": 
     433            chart_tag = plone42chart_tag 
    405434 
    406435        self.loginAsPortalOwner() 
Note: See TracChangeset for help on using the changeset viewer.