Show
Ignore:
Timestamp:
03/27/08 16:59:44 (8 months ago)
Author:
JensDiemer
Message:

add a experimental new cache middleware
-merge pagestats into cache middleware
-add unitest for the cache
-move setup_debug() from the views into the common middleware
-update other tests

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/tests/utils/BrowserDebug.py

    r1501 r1510  
    5858    stack_info = "".join(stack) 
    5959 
    60     info = ( 
    61         "\n<br /><hr />\n" 
    62         "<h3>Unittest info</h3>\n" 
    63         "<dl>\n" 
    64         "<dt>url:</dt><dd>%s</dd>\n" 
    65         "<dt>traceback:</dt><dd><pre>%s</pre></dd>\n" 
    66         "</dl>\n" 
    67         "</body>" 
    68     ) % (url, stack_info) 
    69  
    70     content = content.replace("</body>", info) 
     60    if "</body>" in content: 
     61        info = ( 
     62            "\n<br /><hr />\n" 
     63            "<h3>Unittest info</h3>\n" 
     64            "<dl>\n" 
     65            "<dt>url:</dt><dd>%s</dd>\n" 
     66            "<dt>response info:</dt><dd><pre>%s</pre></dd>\n" 
     67            "<dt>traceback:</dt><dd><pre>%s</pre></dd>\n" 
     68            "</dl>\n" 
     69            "</body>" 
     70        ) % (url, response, stack_info) 
     71        content = content.replace("</body>", info) 
     72    else: 
     73        # Not a html page? 
     74        content += "\n<pre>\n" 
     75        content += "-" * 79 
     76        content += ( 
     77            "\nUnittest info\n" 
     78            "=============\n" 
     79            "url: %s\n" 
     80            "response info:\n%s\n" 
     81            "traceback:\n%s\n</pre>" 
     82        ) % (url, response, stack_info) 
    7183 
    7284