aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.py7
-rw-r--r--tests/views.py4
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/tests.py b/tests/tests.py
index 1188ee0..9194325 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -4,6 +4,7 @@ from __future__ import unicode_literals
import logging
import threading
+from xml.etree import ElementTree as ET
import django
from django.conf import settings
@@ -191,6 +192,12 @@ class DebugToolbarIntegrationTestCase(TestCase):
if not six.PY3:
self.assertContains(response, 'là')
+ def test_xml_validation(self):
+ response = self.client.get('/regular/XML/')
+ with open('/tmp/blah.html', 'wb') as f:
+ f.write(response.content)
+ ET.fromstring(response.content) # shouldn't raise ParseError
+
class DebugToolbarNameFromObjectTest(BaseTestCase):
diff --git a/tests/views.py b/tests/views.py
index a903bee..8b51706 100644
--- a/tests/views.py
+++ b/tests/views.py
@@ -13,7 +13,7 @@ def execute_sql(request):
def regular_view(request, title):
- content = '<html><head><title>%s</title><body></body></html>' % title
+ content = '<html><head><title>%s</title></head><body></body></html>' % title
return HttpResponse(content)
@@ -26,4 +26,4 @@ def set_session(request):
request.session['où'] = 'où'
if not six.PY3:
request.session['là'.encode('utf-8')] = 'là'.encode('utf-8')
- return HttpResponse('<html><head><title></title><body></body></html>')
+ return HttpResponse('<html><head></head><body></body></html>')