diff options
| author | Simon Charette <charette.s@gmail.com> | 2014-11-16 02:05:54 +0100 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2014-11-16 02:12:36 +0100 |
| commit | 68ef44c565d901945eb74768d439c93678315cf6 (patch) | |
| tree | 344b6ff1ae9b57b6cae465f460fabe0d4958901e /tests/annotations | |
| parent | 5b9470efd8725eb349e6f3a66b0ea1073ede5b47 (diff) | |
Removed references to the deprecated assertRaisesRegexp method.
Diffstat (limited to 'tests/annotations')
| -rw-r--r-- | tests/annotations/tests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/annotations/tests.py b/tests/annotations/tests.py index afc23b85df..b0886266f6 100644 --- a/tests/annotations/tests.py +++ b/tests/annotations/tests.py @@ -9,6 +9,7 @@ from django.db.models import ( IntegerField, BooleanField, CharField) from django.db.models.fields import FieldDoesNotExist from django.test import TestCase +from django.utils import six from .models import Author, Book, Store, DepartmentStore, Company, Employee @@ -75,7 +76,7 @@ class NonAggregateAnnotationTestCase(TestCase): self.assertEqual(book.sum_rating, book.rating) def test_filter_wrong_annotation(self): - with self.assertRaisesRegexp(FieldError, "Cannot resolve keyword .*"): + with six.assertRaisesRegex(self, FieldError, "Cannot resolve keyword .*"): list(Book.objects.annotate( sum_rating=Sum('rating') ).filter(sum_rating=F('nope'))) @@ -137,7 +138,7 @@ class NonAggregateAnnotationTestCase(TestCase): self.assertEqual(book.rating, 5) self.assertEqual(book.other_rating, 4) - with self.assertRaisesRegexp(FieldDoesNotExist, "\w has no field named u?'other_rating'"): + with six.assertRaisesRegex(self, FieldDoesNotExist, "\w has no field named u?'other_rating'"): book = qs.defer('other_rating').get(other_rating=4) def test_mti_annotations(self): |
