File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535import os
3636import re
3737import sys
38+ import html5lib
3839from datetime import datetime
3940import urllib2 as urllib
4041from difflib import unified_diff
@@ -286,6 +287,8 @@ class TestCase(django.test.TestCase):
286287 We don't flush the database, as that triggers a re-load of initial_data.
287288 """
288289
290+ parser = html5lib .HTMLParser (strict = True )
291+
289292 def _fixture_setup (self ):
290293 global loaded_fixtures
291294
@@ -316,3 +319,15 @@ def _fixture_setup(self):
316319 loaded_fixtures += fixtures
317320
318321 super (TestCase , self )._fixture_setup ()
322+
323+
324+ def assertValidHTML (self , data ):
325+ try :
326+ parser .parse (data )
327+ except Exception as e :
328+ raise self .failureException (str (e ))
329+
330+ def assertValidHTMLResponse (self , resp ):
331+ self .assertHttpOK (resp )
332+ self .assertTrue (resp ['Content-Type' ].startswith ('text/html' ))
333+ self .assertValidHTML (resp .content )
Original file line number Diff line number Diff line change 77
88# --- Add entries at the top ---
99
10- personal/lars/6.0.2.dev0@9526
10+ personal/rjs/v6.0.2.dev0@9540:9542
11+ #personal/lars/6.0.2.dev0@9526
1112personal/lars/6.0.2.dev0@9525
1213personal/lars/6.0.2.dev0@9524
1314personal/willem/v5.12.4.dev0@9316
Original file line number Diff line number Diff line change @@ -11,11 +11,13 @@ html5lib>=0.90
1111mimeparse >= 0.1.3 # for TastPie
1212MySQL-python >= 1.2.5
1313pathlib >= 1.0
14+ pip >= 6.0
1415pyflakes >= 0.8.1
1516pyquery > 1.2.4
1617python-dateutil >= 2.2
1718python-magic >= 0.4.6
1819pytz >= 2014.7
20+ setuptools >= 1.2
1921six >= 1.8.0
2022django-tastypie >= 0.12.1
2123wsgiref >= 0.1.2
You can’t perform that action at this time.
0 commit comments