Ticket #7697: 7697.2.diff

File 7697.2.diff, 2.7 KB (added by Chris Beaven, 14 years ago)
  • django/views/debug.py

    diff --git a/django/views/debug.py b/django/views/debug.py
    index a396d36..df62dbf 100644
    a b TECHNICAL_500_TEMPLATE = """  
    412412<body>
    413413<div id="summary">
    414414  <h1>{{ exception_type }} at {{ request.path_info|escape }}</h1>
    415   <pre class="exception_value">{{ exception_value|escape }}</pre>
     415  <pre class="exception_value">{{ exception_value|force_escape }}</pre>
    416416  <table class="meta">
    417417    <tr>
    418418      <th>Request Method:</th>
    TECHNICAL_500_TEMPLATE = """  
    432432    </tr>
    433433    <tr>
    434434      <th>Exception Value:</th>
    435       <td><pre>{{ exception_value|escape }}</pre></td>
     435      <td><pre>{{ exception_value|force_escape }}</pre></td>
    436436    </tr>
    437437    <tr>
    438438      <th>Exception Location:</th>
    TECHNICAL_500_TEMPLATE = """  
    459459{% if unicode_hint %}
    460460<div id="unicode-hint">
    461461    <h2>Unicode error hint</h2>
    462     <p>The string that could not be encoded/decoded was: <strong>{{ unicode_hint|escape }}</strong></p>
     462    <p>The string that could not be encoded/decoded was: <strong>{{ unicode_hint|force_escape }}</strong></p>
    463463</div>
    464464{% endif %}
    465465{% if template_does_not_exist %}
    TECHNICAL_500_TEMPLATE = """  
    532532              <tbody>
    533533                {% for var in frame.vars|dictsort:"0" %}
    534534                  <tr>
    535                     <td>{{ var.0|escape }}</td>
    536                     <td class="code"><div>{{ var.1|pprint|escape }}</div></td>
     535                    <td>{{ var.0|force_escape }}</td>
     536                    <td class="code"><div>{{ var.1|pprint|force_escape }}</div></td>
    537537                  </tr>
    538538                {% endfor %}
    539539              </tbody>
    Traceback:  
    582582{% if frame.context_line %}  {{ frame.lineno }}. {{ frame.context_line|escape }}{% endif %}
    583583{% endfor %}
    584584Exception Type: {{ exception_type|escape }} at {{ request.path_info|escape }}
    585 Exception Value: {{ exception_value|escape }}
     585Exception Value: {{ exception_value|force_escape }}
    586586</textarea>
    587587  <br><br>
    588588  <input type="submit" value="Share this traceback on a public Web site">
  • tests/runtests.py

    diff --git a/tests/runtests.py b/tests/runtests.py
    index a52152b..270beae 100755
    a b if __name__ == "__main__":  
    198198    if options.settings:
    199199        os.environ['DJANGO_SETTINGS_MODULE'] = options.settings
    200200    elif "DJANGO_SETTINGS_MODULE" not in os.environ:
    201         parser.error("DJANGO_SETTINGS_MODULE is not set in the environment. "
    202                       "Set it or use --settings.")
     201        from django.conf import settings
     202        settings.configure(DATABASE_ENGINE='sqlite3')
    203203    django_tests(int(options.verbosity), options.interactive, options.failfast, args)
Back to Top