          If a SELECT...FOR UPDATE NOWAIT is run on a database backend
          that supports FOR UPDATE but not NOWAIT, then we should find
          that a DatabaseError is raised.
          """
          self.assertRaises(
              DatabaseError,
              list,
              Person.objects.all().select_for_update(nowait=True)
          )
  
      @skipUnlessDBFeature('has_select_for_update')
      def test_for_update_requires_transaction(self):
          """
          Test that a TransactionManagementError is raised
 
</s> remove         self.assertRaises(CommandError, management.call_command, ('explode',))
 </s> add         with self.assertRaises(CommandError):
            management.call_command(('explode',)) </s> remove         self.assertRaises(ImproperlyConfigured, Sitemap().get_urls)
 </s> add         with self.assertRaises(ImproperlyConfigured):
            Sitemap().get_urls() </s> remove         self.assertRaises(ImproperlyConfigured,
                          self.client.get,
                          '/syndication/articles/')
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.client.get('/syndication/articles/') </s> remove         self.assertRaises(FieldError, Poll.objects.get,
            choice__name__exact="This is the answer")
 </s> add         with self.assertRaises(FieldError):
            Poll.objects.get(choice__name__exact="This is the answer") </s> remove         self.assertRaises(ObjectDoesNotExist, get_current_site, request)
 </s> add         with self.assertRaises(ObjectDoesNotExist):
            get_current_site(request)
        with self.assertRaises(DatabaseError):
            list(Person.objects.all().select_for_update(nowait=True))
          If a SELECT...FOR UPDATE NOWAIT is run on a database backend
          that supports FOR UPDATE but not NOWAIT, then we should find
          that a DatabaseError is raised.
          """
        with self.assertRaises(DatabaseError):
            list(Person.objects.all().select_for_update(nowait=True))
        with self.assertRaises(DatabaseError):
            list(Person.objects.all().select_for_update(nowait=True))
        with self.assertRaises(DatabaseError):
            list(Person.objects.all().select_for_update(nowait=True))
        with self.assertRaises(DatabaseError):
            list(Person.objects.all().select_for_update(nowait=True))
        with self.assertRaises(DatabaseError):
            list(Person.objects.all().select_for_update(nowait=True))
  
      @skipUnlessDBFeature('has_select_for_update')
      def test_for_update_requires_transaction(self):
          """
          Test that a TransactionManagementError is raised
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/select_for_update/tests.py