diff --git a/django/test/testcases.py b/django/test/testcases.py
index 2ea5190..2b0590f 100644
|
a
|
b
|
import threading
|
| 12 | 12 | import unittest |
| 13 | 13 | import warnings |
| 14 | 14 | from collections import Counter |
| | 15 | from contextlib import contextmanager |
| 15 | 16 | from copy import copy |
| 16 | 17 | from functools import wraps |
| 17 | 18 | from unittest.util import safe_repr |
| … |
… |
class SimpleTestCase(unittest.TestCase):
|
| 604 | 605 | msg_prefix + "Template '%s' was used unexpectedly in rendering" |
| 605 | 606 | " the response" % template_name) |
| 606 | 607 | |
| | 608 | @contextmanager |
| 607 | 609 | def assertRaisesMessage(self, expected_exception, expected_message, *args, **kwargs): |
| 608 | 610 | """ |
| 609 | 611 | Asserts that the message in a raised exception matches the passed |
| … |
… |
class SimpleTestCase(unittest.TestCase):
|
| 623 | 625 | 'as an arg instead.', RemovedInDjango20Warning |
| 624 | 626 | ) |
| 625 | 627 | args = (callable_obj,) + args |
| 626 | | return six.assertRaisesRegex(self, expected_exception, |
| 627 | | re.escape(expected_message), *args, **kwargs) |
| | 628 | |
| | 629 | with self.assertRaises(expected_exception) as cm: |
| | 630 | yield cm |
| | 631 | err = cm.exception |
| | 632 | self.assertIn(expected_message, str(err)) |
| 628 | 633 | |
| 629 | 634 | def assertFieldOutput(self, fieldclass, valid, invalid, field_args=None, |
| 630 | 635 | field_kwargs=None, empty_value=''): |