summaryrefslogtreecommitdiff
path: root/tests/generic_relations_regress
diff options
context:
space:
mode:
authorHasan <hasan.r67@gmail.com>2016-01-17 14:56:39 +0330
committerTim Graham <timograham@gmail.com>2016-01-29 12:32:18 -0500
commit3d0dcd7f5af378d3ab6adb303b913e6c7b2e0ee5 (patch)
tree0d1074cc65a72096e44a4165611fddfc5b7ef7fb /tests/generic_relations_regress
parent575706331bec4bf58ce36a9540c4c61fca49025b (diff)
downloaddjango-3d0dcd7f5af378d3ab6adb303b913e6c7b2e0ee5.tar.gz
Refs #26022 -- Used context manager version of assertRaises in tests.
Diffstat (limited to 'tests/generic_relations_regress')
-rw-r--r--tests/generic_relations_regress/tests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/generic_relations_regress/tests.py b/tests/generic_relations_regress/tests.py
index b6782fe13f..957f285b23 100644
--- a/tests/generic_relations_regress/tests.py
+++ b/tests/generic_relations_regress/tests.py
@@ -111,7 +111,8 @@ class GenericRelationTests(TestCase):
# Fails with another, ORM-level error
dev1 = Developer(name='Joe')
note = Note(note='Deserves promotion', content_object=dev1)
- self.assertRaises(IntegrityError, note.save)
+ with self.assertRaises(IntegrityError):
+ note.save()
def test_target_model_len_zero(self):
"""Test for #13085 -- __len__() returns 0"""