[1.8.x] Fixed #24903 -- Fixed assertRaisesMessage on Python 2.7.10.

A regression in Python 2.7.10 rc1 wasn't reverted in the final
release: https://bugs.python.org/issue24134

Backport of two commits from master:
* c2bc1cefdc
* e89c3a4603
This commit is contained in:
Tim Graham 2015-05-09 19:13:05 -04:00
parent b3f61f6e08
commit 8bc18ebf0f
4 changed files with 21 additions and 5 deletions

View file

@ -752,6 +752,12 @@ class AssertRaisesMsgTest(SimpleTestCase):
raise ValueError("[.*x+]y?")
self.assertRaisesMessage(ValueError, "[.*x+]y?", func1)
def test_callable_obj_param(self):
# callable_obj was a documented kwarg in older version of Django.
def func1():
raise ValueError("[.*x+]y?")
self.assertRaisesMessage(ValueError, "[.*x+]y?", callable_obj=func1)
class AssertFieldOutputTests(SimpleTestCase):