summaryrefslogtreecommitdiff
path: root/django/test
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-10-03 09:25:48 +0200
committerGitHub <noreply@github.com>2023-10-03 09:25:48 +0200
commit679212a47ac3e22a6fbb6ee3cd4c09f29aae8b5d (patch)
treece0cb4c08f56a0a77725fd1ce926dda13d22c054 /django/test
parent35bbb2c9c01882b1d77b0b8c737ac646144833d4 (diff)
Refs #34657 -- Made msg_prefix handling in assertURLEqual()/assertInHTML consistent with other assertions.
Co-authored-by: Chinmoy Chakraborty <chinmoy12c@gmail.com>
Diffstat (limited to 'django/test')
-rw-r--r--django/test/testcases.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index 391b5e99cc..bdb64b3a15 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -463,6 +463,8 @@ class SimpleTestCase(unittest.TestCase):
(scheme, netloc, path, params, urlencode(query_parts), fragment)
)
+ if msg_prefix:
+ msg_prefix += ": "
self.assertEqual(
normalize(url1),
normalize(url2),
@@ -880,6 +882,8 @@ class SimpleTestCase(unittest.TestCase):
self, haystack, None, "Second argument is not valid HTML:"
)
real_count = parsed_haystack.count(parsed_needle)
+ if msg_prefix:
+ msg_prefix += ": "
if count is not None:
self.assertEqual(
real_count,