Changeset 3171 in products for quintagroup.analytics
- Timestamp:
- Apr 22, 2011 9:08:32 AM (13 years ago)
- Location:
- quintagroup.analytics/trunk/quintagroup/analytics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.analytics/trunk/quintagroup/analytics/browser/views.py
r3170 r3171 14 14 IPortletAssignmentSettings 15 15 except ImportError: 16 "Before plon4 we don't have an annotation storage for settings."16 # Before plon4 we don't have an annotation storage for settings. 17 17 IPortletAssignmentSettings = lambda assignment: {} 18 18 … … 144 144 if haslen: 145 145 data[k] = len(index._index[k]) 146 146 147 else: 147 148 data[k] = 1 149 148 150 data = data.items() 149 151 data.sort(lambda a, b: a[1] - b[1]) -
quintagroup.analytics/trunk/quintagroup/analytics/tests.py
r3170 r3171 40 40 @classmethod 41 41 def tearDown(cls): 42 42 pass 43 43 44 44 … … 65 65 uf = portal.acl_users 66 66 pm = portal.portal_membership 67 portal.portal_catalog67 #portal.portal_catalog 68 68 users = [u[0] for u in cls.users] 69 69 for u in users: … … 186 186 continue 187 187 haslen = hasattr(index._index[k], '__len__') 188 188 189 if haslen: 189 190 data[k] = len(index._index[k]) 190 191 else: 191 192 data[k] = 1 193 192 194 data = data.items() 193 195 data.sort(lambda a, b: a[1] - b[1]) … … 216 218 """ This test verifies creation of chart image tag.""" 217 219 plone33chart_tag = \ 218 """<imgsrc="http://chart.apis.google.com/chart?chxt=y&chds=0,219 57&chd=t:19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0,220 10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0,10.0|221 19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0,10.0|0.0,222 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.0,223 0.0,0.0,0.0,0.0,0.0,0.0&chxr=0,0,57&224 chco=669933,cc9966,993300,ff6633,e8e4e3,a9a486,225 dcb57e,ffcc99,996633,333300,00ff00&226 chl=user9|user8|user7|user6|user5|user4|user3|user2|user1|227 user0&chbh=a,10,0&chs=800x375&cht=bvs&228 chtt=Content+ownership+by+type&chdl=Folder|Document|Event229 |Large+Plone+Folder|Topic&chdlp=b"/>"""220 '<imgsrc="http://chart.apis.google.com/chart?chxt=y&chds=0,'\ 221 '57&chd=t:19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0,'\ 222 '10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0,10.0|'\ 223 '19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,11.0,10.0|0.0,'\ 224 '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.0,'\ 225 '0.0,0.0,0.0,0.0,0.0,0.0&chxr=0,0,57&'\ 226 'chco=669933,cc9966,993300,ff6633,e8e4e3,a9a486,'\ 227 'dcb57e,ffcc99,996633,333300,00ff00&'\ 228 'chl=user9|user8|user7|user6|user5|user4|user3|user2|user1|'\ 229 'user0&chbh=a,10,0&chs=800x375&cht=bvs&'\ 230 'chtt=Content+ownership+by+type&chdl=Folder|Document|Event'\ 231 '|Large+Plone+Folder|Topic&chdlp=b"/>' 230 232 plone4chart_tag = \ 231 """<img src="http://chart.apis.google.com/chart?chxt=y&232 chds=0,57&chd=t:19.0,18.0,17.0,16.0,15.0,14.0,233 13.0,12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,234 12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,235 11.0,10.0|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0&236 chxr=0,0,57&chco=669933,cc9966,993300,ff6633,e8e4e3,237 a9a486,dcb57e,ffcc99,996633,333300,00ff00&chl=user9|238 user8|user7|user6|user5|user4|user3|user2|user1|user0&239 chbh=a,10,0&chs=800x375&cht=bvs&240 chtt=Content+ownership+by+type&chdl=Folder|Document|241 Event|Topic&chdlp=b" />"""233 '<img src="http://chart.apis.google.com/chart?chxt=y&'\ 234 'chds=0,57&chd=t:19.0,18.0,17.0,16.0,15.0,14.0,'\ 235 '13.0,12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,'\ 236 '12.0,11.0,10.0|19.0,18.0,17.0,16.0,15.0,14.0,13.0,12.0,'\ 237 '11.0,10.0|0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0&'\ 238 'chxr=0,0,57&chco=669933,cc9966,993300,ff6633,e8e4e3,'\ 239 'a9a486,dcb57e,ffcc99,996633,333300,00ff00&chl=user9|'\ 240 'user8|user7|user6|user5|user4|user3|user2|user1|user0&'\ 241 'chbh=a,10,0&chs=800x375&cht=bvs&'\ 242 'chtt=Content+ownership+by+type&chdl=Folder|Document|'\ 243 'Event|Topic&chdlp=b" />' 242 244 chart_tag = plone4chart_tag 243 245 if not PLONE40: … … 320 322 index = self.pc._catalog.getIndex('portal_type') 321 323 data = {} 324 322 325 for k in index._index.keys(): 323 326 if not k: 324 327 continue 325 328 haslen = hasattr(index._index[k], '__len__') 329 326 330 if haslen: 327 331 data[k] = len(index._index[k]) 332 328 333 else: 329 334 data[k] = 1 … … 331 336 data.sort(lambda a, b: a[1] - b[1]) 332 337 data.reverse() 338 333 339 types = [i[0] for i in data] 334 340 self.assert_(False not in map(lambda t1, t2: t1 == t2, types, … … 359 365 """ This test verifies creation of chart image tag.""" 360 366 plone33chart_tag = \ 361 """<imgsrc="http://chart.apis.google.com/chart?chxt=y&chds=0,362 156&chd=t:156.0,145.0,145.0,0.0,0.0|0.0,1.0,0.0,3.0,3.0|363 0.0,0.0,0.0,0.0,0.0&chxr=0,0,156&chco=669933,cc9966,364 993300,ff6633,e8e4e3,a9a486,dcb57e,ffcc99,996633,333300,365 00ff00&chl=Folder|Document|Event|Large+Plone+Folder|366 Topic&chbh=a,10,0&chs=800x375&cht=bvs&367 chtt=Content+type+by+state&chdl=private|published|368 No+workflow&chdlp=b"/>"""367 '<imgsrc="http://chart.apis.google.com/chart?chxt=y&chds=0,'\ 368 '156&chd=t:156.0,145.0,145.0,0.0,0.0|0.0,1.0,0.0,3.0,3.0|'\ 369 '0.0,0.0,0.0,0.0,0.0&chxr=0,0,156&chco=669933,cc9966,'\ 370 '993300,ff6633,e8e4e3,a9a486,dcb57e,ffcc99,996633,333300,'\ 371 '00ff00&chl=Folder|Document|Event|Large+Plone+Folder|'\ 372 'Topic&chbh=a,10,0&chs=800x375&cht=bvs&'\ 373 'chtt=Content+type+by+state&chdl=private|published|'\ 374 'No+workflow&chdlp=b"/>' 369 375 plone4chart_tag = \ 370 """<imgsrc="http://chart.apis.google.com/chart?chxt=y&371 chds=0,159&chd=t:156.0,145.0,145.0,0.0|3.0,1.0,0.0,372 3.0|0.0,0.0,0.0,0.0&chxr=0,0,159&chco=669933,373 cc9966,993300,ff6633,e8e4e3,a9a486,dcb57e,ffcc99,996633,374 333300,00ff00&chl=Folder|Document|Event|Topic&375 chbh=a,10,0&chs=800x375&cht=bvs&376 chtt=Content+type+by+state&chdl=private|published|377 No+workflow&chdlp=b"/>"""376 '<imgsrc="http://chart.apis.google.com/chart?chxt=y&'\ 377 'chds=0,159&chd=t:156.0,145.0,145.0,0.0|3.0,1.0,0.0,'\ 378 '3.0|0.0,0.0,0.0,0.0&chxr=0,0,159&chco=669933,'\ 379 'cc9966,993300,ff6633,e8e4e3,a9a486,dcb57e,ffcc99,996633,'\ 380 '333300,00ff00&chl=Folder|Document|Event|Topic&'\ 381 'chbh=a,10,0&chs=800x375&cht=bvs&'\ 382 'chtt=Content+type+by+state&chdl=private|published|'\ 383 'No+workflow&chdlp=b"/>' 378 384 379 385 chart_tag = plone4chart_tag … … 442 448 self.view.getPropsList()) 443 449 lslots = plone_portlets_info[0]['left_slots'] 444 self.assert_( filter(lambda info: info['title'] == 'Calendar', lslots))450 self.assert_(info for info in lslots if info['title'] == 'Calendar') 445 451 446 452
Note: See TracChangeset
for help on using the changeset viewer.