Changeset 3042 in products for quintagroup.analytics/trunk/quintagroup/analytics/tests.py
- Timestamp:
- Nov 18, 2010 3:42:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.analytics/trunk/quintagroup/analytics/tests.py
r3033 r3042 9 9 10 10 from Products.PloneTestCase import PloneTestCase as ptc 11 from Products.PloneTestCase.version import PLONE33 11 12 from Products.PloneTestCase import setup as ptc_setup 12 13 from Products.PloneTestCase.layer import PloneSite … … 209 210 def test_getChart(self): 210 211 """ This test verifies creation of chart image tag.""" 211 chart_tag = """<img src="http://chart.apis.google.com/chart?chxt=y& 212 chds=0,57&chd=t:19.0,18.0,17.0,16.0,15.0,14.0, 213 13.0,12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0, 214 12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0, 215 11.0,10.0|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0& 216 chxr=0,0,57&chco=669933,cc9966,993300,ff6633,e8e4e3, 217 a9a486,dcb57e,ffcc99,996633,333300,00ff00&chl=user9| 218 user8|user7|user6|user5|user4|user3|user2|user1|user0& 219 chbh=a,10,0&chs=800x375&cht=bvs& 220 chtt=Content+ownership+by+type&chdl=Folder|Document| 221 Event|Topic&chdlp=b" />""" 212 plone33chart_tag = \ 213 """<imgsrc="http://chart.apis.google.com/chart?chxt=y& 214 chds=0,57&chd=t:19.0,18.0,17.0,16.0,15.0,14.0,13.0, 215 12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0, 216 11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0, 217 10.0|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0|0.0,0.0, 218 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0&chxr=0,0,57& 219 chco=669933,cc9966,993300,ff6633,e8e4e3,a9a486,dcb57e, 220 ffcc99,996633,333300,00ff00&chl=user9|user8| 221 user7|user6|user5|user4|user3|user2|user1|user0& 222 chbh=a,10,0&chs=800x375&cht=bvs& 223 chtt=Content+ownership+by+type&chdl=Folder| 224 Document|Event|Large+Plone+Folder|Topic&chdlp=b"/>""" 225 plone4chart_tag = \ 226 """<img src="http://chart.apis.google.com/chart?chxt=y& 227 chds=0,57&chd=t:19.0,18.0,17.0,16.0,15.0,14.0, 228 13.0,12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0, 229 12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0, 230 11.0,10.0|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0& 231 chxr=0,0,57&chco=669933,cc9966,993300,ff6633,e8e4e3, 232 a9a486,dcb57e,ffcc99,996633,333300,00ff00&chl=user9| 233 user8|user7|user6|user5|user4|user3|user2|user1|user0& 234 chbh=a,10,0&chs=800x375&cht=bvs& 235 chtt=Content+ownership+by+type&chdl=Folder|Document| 236 Event|Topic&chdlp=b" />""" 237 chart_tag = PLONE33 and plone33chart_tag or plone4chart_tag 238 222 239 self.loginAsPortalOwner() 223 240 self.assertEqual(*map(lambda s:''.join(s.split()), … … 291 308 def test_getTypes(self): 292 309 """ Tests method that returns ordered list of types.""" 293 self.assert_(False not in map(lambda t1, t2:t1==t2, 294 ['Folder', 'Document', 'Event', 'Topic'], 310 index = self.pc._catalog.getIndex('portal_type') 311 data = {} 312 for k in index._index.keys(): 313 if not k: 314 continue 315 haslen = hasattr(index._index[k], '__len__') 316 if haslen: 317 data[k] = len(index._index[k]) 318 else: 319 data[k] = 1 320 data = data.items() 321 data.sort(lambda a, b: a[1] - b[1]) 322 data.reverse() 323 types = [i[0] for i in data] 324 self.assert_(False not in map(lambda t1, t2:t1==t2, types, 295 325 self.view.getTypes())) 296 326 … … 318 348 def test_getChart(self): 319 349 """ This test verifies creation of chart image tag.""" 320 chart_tag = """ <imgsrc="http://chart.apis.google.com/chart?chxt=y& 321 chds=0,159&chd=t:156.0,145.0,145.0,0.0|3.0,1.0,0.0, 322 3.0|0.0,0.0,0.0,0.0&chxr=0,0,159&chco=669933, 323 cc9966,993300,ff6633,e8e4e3,a9a486,dcb57e,ffcc99,996633, 324 333300,00ff00&chl=Folder|Document|Event|Topic& 325 chbh=a,10,0&chs=800x375&cht=bvs& 326 chtt=Content+type+by+state&chdl=private|published| 327 No+workflow&chdlp=b"/>""" 350 plone33chart_tag = \ 351 """<imgsrc="http://chart.apis.google.com/chart?chxt=y&chds=0, 352 156&chd=t:156.0,145.0,145.0,0.0,0.0|0.0,1.0,0.0,3.0,3.0| 353 0.0,0.0,0.0,0.0,0.0&chxr=0,0,156&chco=669933,cc9966, 354 993300,ff6633,e8e4e3,a9a486,dcb57e,ffcc99,996633,333300, 355 00ff00&chl=Folder|Document|Event|Large+Plone+Folder| 356 Topic&chbh=a,10,0&chs=800x375&cht=bvs& 357 chtt=Content+type+by+state&chdl=private|published| 358 No+workflow&chdlp=b"/>""" 359 plone4chart_tag = \ 360 """<img src="http://chart.apis.google.com/chart?chxt=y& 361 chds=0,57&chd=t:19.0,18.0,17.0,16.0,15.0,14.0, 362 13.0,12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0, 363 12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0, 364 11.0,10.0|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0& 365 chxr=0,0,57&chco=669933,cc9966,993300,ff6633,e8e4e3, 366 a9a486,dcb57e,ffcc99,996633,333300,00ff00&chl=user9| 367 user8|user7|user6|user5|user4|user3|user2|user1|user0& 368 chbh=a,10,0&chs=800x375&cht=bvs& 369 chtt=Content+ownership+by+type&chdl=Folder|Document| 370 Event|Topic&chdlp=b" />""" 371 chart_tag = PLONE33 and plone33chart_tag or plone4chart_tag 328 372 329 373 self.loginAsPortalOwner()
Note: See TracChangeset
for help on using the changeset viewer.