          """
          We do not support update on already sliced query sets.
          """
          method = DataPoint.objects.all()[:2].update
          self.assertRaises(AssertionError, method,
                            another_value='another thing')
  
      def test_update_respects_to_field(self):
          """
          Update of an FK field which specifies a to_field works.
          """
 
</s> remove         self.assertRaises(FieldError, test_gmbh.save)
 </s> add         with self.assertRaises(FieldError):
            test_gmbh.save() </s> remove             self.assertRaises(
                NotImplementedError,
                City.objects.all().aggregate, MakeLine('point')
            )
 </s> add             with self.assertRaises(NotImplementedError):
                City.objects.all().aggregate(MakeLine('point')) </s> remove         self.assertRaises(GEOSException, g.transform, 2774)
 </s> add         with self.assertRaises(GEOSException):
            g.transform(2774) </s> remove             self.assertRaises(IndexError, lambda: IndexErrorArticle.objects.all()[0])
            self.assertRaises(IndexError, IndexErrorArticle.objects.all().first)
            self.assertRaises(IndexError, IndexErrorArticle.objects.all().last)
 </s> add             with self.assertRaises(IndexError):
                IndexErrorArticle.objects.all()[0]
            with self.assertRaises(IndexError):
                IndexErrorArticle.objects.all().first()
            with self.assertRaises(IndexError):
                IndexErrorArticle.objects.all().last() </s> remove         self.assertRaises(IntegrityError, a2.save)
 </s> add         with self.assertRaises(IntegrityError):
            a2.save()
        with self.assertRaises(AssertionError):
            method(another_value='another thing')
          """
          We do not support update on already sliced query sets.
          """
          method = DataPoint.objects.all()[:2].update
        with self.assertRaises(AssertionError):
            method(another_value='another thing')
        with self.assertRaises(AssertionError):
            method(another_value='another thing')
  
      def test_update_respects_to_field(self):
          """
          Update of an FK field which specifies a to_field works.
          """
keep keep keep keep replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/update/tests.py