Changeset 13808 for main/waeup.ikoba/trunk/src/waeup
- Timestamp:
- 6 Apr 2016, 11:17:16 (9 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/browser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/pages.py
r13806 r13808 20 20 # XXX: All csv ops should move to a dedicated module soon 21 21 import unicodecsv as csv 22 import cgi 22 23 import grok 23 24 import os … … 1561 1562 return 1562 1563 try: 1563 self.result = ''.join(1564 self.context.queryLogfiles(logname, query))1564 self.result = cgi.escape( 1565 ''.join(self.context.queryLogfiles(logname, query))) 1565 1566 except ValueError: 1566 1567 self.flash(_('Invalid search expression.'), type='danger') -
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/pdf.py
r12492 r13808 94 94 fontName='Helvetica', 95 95 fontSize=10, 96 leading=9,96 #leading=9, 97 97 ) 98 98 -
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/tests/test_browser.py
r13806 r13808 1 # -*- coding: utf-8 -*- 1 2 ## $Id: test_browser.py 12840 2015-04-01 08:35:16Z henrik $ 2 3 ## … … 91 92 shutil.rmtree(os.path.dirname(job.result)) 92 93 94 def test_logs_listed(self): 95 # existing logfiles are listed in logs overview 96 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 97 log_path = os.path.join( 98 self.app['datacenter'].storage, 'logs', 'myspecial.log') 99 with open(log_path, "a") as fd: 100 fd.write("SOME FOO IN LOGFILE") 101 self.browser.open(self.datacenter_path + "/logs") 102 assert "myspecial.log" in self.browser.contents 103 104 def test_view_log(self): 105 # single logfiles can be watched (with filter regexp) 106 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 107 log_path = os.path.join( 108 self.app['datacenter'].storage, 'logs', 'myspecial.log') 109 with open(log_path, "a") as fd: 110 fd.write("SOME FOO IN LOGFILE") 111 self.browser.open( 112 self.datacenter_path + "/@@show/?logname=myspecial.log&query=.*") 113 assert "SOME FOO IN LOGFILE" in self.browser.contents 114 115 def test_html_in_logs_escaped(self): 116 # HTML code in logfiles is escaped before output. 117 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 118 log_path = os.path.join( 119 self.app['datacenter'].storage, 'logs', 'myspecial.log') 120 with open(log_path, "a") as fd: 121 fd.write("SOME <TAG> AND ÜMLÄUTS IN LOG") 122 self.browser.open( 123 self.datacenter_path + "/@@show/?logname=myspecial.log&query=.*") 124 assert "SOME <TAG> AND ÜMLÄUTS IN LOG" in self.browser.contents 125 93 126 def test_user_data_import_permission(self): 94 127 upload_path = 'http://localhost/app/datacenter/upload'
Note: See TracChangeset for help on using the changeset viewer.