          # Valid query, but fails because foo isn't a keyword
          self.assertRaises(FieldError, Choice.objects.filter, foo__exact=None)
  
          # Can't use None on anything other than __exact and __iexact
          self.assertRaises(ValueError, Choice.objects.filter, id__gt=None)
  
          # Related managers use __exact=None implicitly if the object hasn't been saved.
          p2 = Poll(question="How?")
          self.assertEqual(repr(p2.choice_set.all()), '<QuerySet []>')
  
 
</s> remove         self.assertRaises(FieldError, Choice.objects.filter, foo__exact=None)
 </s> add         with self.assertRaises(FieldError):
            Choice.objects.filter(foo__exact=None) </s> remove             self.assertRaises(ctypes.ArgumentError, g.buffer, width, float(quadsegs))
 </s> add             with self.assertRaises(ctypes.ArgumentError):
                g.buffer(width, float(quadsegs)) </s> remove         self.assertRaises(ValueError, qs.aggregate, Union('name'))
 </s> add         with self.assertRaises(ValueError):
            qs.aggregate(Union('name')) </s> remove         self.assertRaises(ValueError, setattr, p, 'restaurant', None)
 </s> add         with self.assertRaises(ValueError):
            setattr(p, 'restaurant', None) </s> remove         self.assertRaises(AssertionError, Person.objects.latest)
 </s> add         with self.assertRaises(AssertionError):
            Person.objects.latest()
        with self.assertRaises(ValueError):
            Choice.objects.filter(id__gt=None)
          # Valid query, but fails because foo isn't a keyword
          self.assertRaises(FieldError, Choice.objects.filter, foo__exact=None)
  
          # Can't use None on anything other than __exact and __iexact
        with self.assertRaises(ValueError):
            Choice.objects.filter(id__gt=None)
  
          # Related managers use __exact=None implicitly if the object hasn't been saved.
          p2 = Poll(question="How?")
          self.assertEqual(repr(p2.choice_set.all()), '<QuerySet []>')
  
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/null_queries/tests.py