summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDmitry Dygalo <dadygalo@gmail.com>2016-07-20 16:12:13 +0200
committerTim Graham <timograham@gmail.com>2016-07-21 17:06:48 -0400
commitb3f96b5f7302a032a704541fe3a38d285c9e2f30 (patch)
tree43bc03780e7527807e8b12105eb6c8a4b56c31df /tests
parent2d1aeccacc7402d3af5e8d5b49f8782b0698c81f (diff)
[1.10.x] Fixed #26922 -- Fixed SimpleTestCase.assertHTMLEqual() crash on Python 3.5+.
Backport of d7a097265b1842843a73ce0da36ef98bacac8a3e from master
Diffstat (limited to 'tests')
-rw-r--r--tests/test_utils/tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
index fd552ad9c2..395884fedf 100644
--- a/tests/test_utils/tests.py
+++ b/tests/test_utils/tests.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+import sys
import unittest
import warnings
@@ -629,6 +630,15 @@ class HTMLEqualTests(SimpleTestCase):
self.assertHTMLEqual('<p>', '')
with self.assertRaises(AssertionError):
self.assertHTMLEqual('', '<p>')
+ error_msg = (
+ "First argument is not valid HTML:\n"
+ "('Unexpected end tag `div` (Line 1, Column 6)', (1, 6))"
+ ) if sys.version_info >= (3, 5) else (
+ "First argument is not valid HTML:\n"
+ "Unexpected end tag `div` (Line 1, Column 6), at line 1, column 7"
+ )
+ with self.assertRaisesMessage(AssertionError, error_msg):
+ self.assertHTMLEqual('< div></ div>', '<div></div>')
with self.assertRaises(HTMLParseError):
parse_html('</p>')