diff options
Diffstat (limited to 'tests/basic/tests.py')
-rw-r--r-- | tests/basic/tests.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/basic/tests.py b/tests/basic/tests.py index c334a8bfc6..95ed7ad897 100644 --- a/tests/basic/tests.py +++ b/tests/basic/tests.py @@ -499,12 +499,8 @@ class ModelLookupTest(TestCase): ) # To avoid dict-ordering related errors check only one lookup # in single assert. - self.assertRaises( - ObjectDoesNotExist, - Article.objects.get, - pub_date__year=2005, - pub_date__month=8, - ) + with self.assertRaises(ObjectDoesNotExist): + Article.objects.get(pub_date__year=2005, pub_date__month=8) six.assertRaisesRegex( self, ObjectDoesNotExist, |