          "Check that the AttributeError from AttributeErrorRouter bubbles up"
          b = Book.objects.create(title="Pro Django",
                                  published=datetime.date(2008, 12, 16))
          with self.override_router():
              self.assertRaises(AttributeError, Book.objects.get, pk=b.pk)
  
      def test_attribute_error_save(self):
          "Check that the AttributeError from AttributeErrorRouter bubbles up"
          dive = Book()
          dive.title = "Dive into Python"
 
</s> remove             self.assertRaises(AttributeError, dive.save)
 </s> add             with self.assertRaises(AttributeError):
                dive.save() </s> remove             self.assertRaises(AttributeError, b.delete)
 </s> add             with self.assertRaises(AttributeError):
                b.delete() </s> remove         self.assertRaises(
            Book.DoesNotExist,
            Book.objects.get,
            title="Dive into Python"
        )
        self.assertRaises(
            Book.DoesNotExist,
            Book.objects.using('default').get,
            title="Dive into Python"
        )
 </s> add         with self.assertRaises(Book.DoesNotExist):
            Book.objects.get(title="Dive into Python")
        with self.assertRaises(Book.DoesNotExist):
            Book.objects.using('default').get(title="Dive into Python") </s> remove         self.assertRaises(Book.DoesNotExist, Book.objects.using('default').get, title__icontains="dive")
 </s> add         with self.assertRaises(Book.DoesNotExist):
            Book.objects.using('default').get(title__icontains="dive") </s> remove         self.assertRaises(Book.DoesNotExist, Book.objects.using('default').get, published=datetime.date(2009, 5, 4))
 </s> add         with self.assertRaises(Book.DoesNotExist):
            Book.objects.using('default').get(published=datetime.date(2009, 5, 4))
            with self.assertRaises(AttributeError):
                Book.objects.get(pk=b.pk)
          "Check that the AttributeError from AttributeErrorRouter bubbles up"
          b = Book.objects.create(title="Pro Django",
                                  published=datetime.date(2008, 12, 16))
          with self.override_router():
            with self.assertRaises(AttributeError):
                Book.objects.get(pk=b.pk)
  
      def test_attribute_error_save(self):
          "Check that the AttributeError from AttributeErrorRouter bubbles up"
          dive = Book()
          dive.title = "Dive into Python"
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/multiple_database/tests.py