mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #16921 -- Added assertHTMLEqual and assertHTMLNotEqual assertions, and converted Django tests to use them where appropriate. Thanks Greg Müllegger.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17414 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -310,7 +310,7 @@ class ModelAdminTests(TestCase):
|
||||
ma = ConcertAdmin(Concert, self.site)
|
||||
form = ma.get_form(request)()
|
||||
|
||||
self.assertEqual(str(form["main_band"]),
|
||||
self.assertHTMLEqual(str(form["main_band"]),
|
||||
'<select name="main_band" id="id_main_band">\n'
|
||||
'<option value="" selected="selected">---------</option>\n'
|
||||
'<option value="%d">The Beatles</option>\n'
|
||||
@@ -331,7 +331,7 @@ class ModelAdminTests(TestCase):
|
||||
ma = ConcertAdmin(Concert, self.site)
|
||||
form = ma.get_form(request)()
|
||||
|
||||
self.assertEqual(str(form["main_band"]),
|
||||
self.assertHTMLEqual(str(form["main_band"]),
|
||||
'<select name="main_band" id="id_main_band">\n'
|
||||
'<option value="" selected="selected">---------</option>\n'
|
||||
'<option value="%d">The Doors</option>\n'
|
||||
|
||||
Reference in New Issue
Block a user