diff --git a/tests/annotations/tests.py b/tests/annotations/tests.py
index 36e6754..7a16cc7 100644
a
|
b
|
class NonAggregateAnnotationTestCase(TestCase):
|
261 | 261 | book_postupdate = Book.objects.get(pk=self.b2.pk) |
262 | 262 | self.assertEqual(book_preupdate.rating - 1, book_postupdate.rating) |
263 | 263 | |
| 264 | def test_joined_f_update_errors_are_clear_when_annotating(self): |
| 265 | error_msg = 'Joined field references are not permitted in this query' |
| 266 | with self.assertRaisesMessage(FieldError, error_msg): |
| 267 | Book.objects.update(name=F('contact__name')) |
| 268 | |
| 269 | with self.assertRaisesMessage(FieldError, error_msg): |
| 270 | Book.objects.annotate( |
| 271 | contact_name=F('contact__name') |
| 272 | ).update(name=F('contact_name')) |
| 273 | |
264 | 274 | def test_annotation_with_m2m(self): |
265 | 275 | books = Book.objects.annotate(author_age=F('authors__age')).filter(pk=self.b1.pk).order_by('author_age') |
266 | 276 | self.assertEqual(books[0].author_age, 34) |