          self.assertRaises(Book.DoesNotExist, Book.objects.using('default').get, title__icontains="dive")
  
          dive = Book.objects.using('other').get(title__iexact="dive INTO python")
          self.assertEqual(dive.title, "Dive into Python")
          self.assertRaises(Book.DoesNotExist, Book.objects.using('default').get, title__iexact="dive INTO python")
  
          dive = Book.objects.using('other').get(published__year=2009)
          self.assertEqual(dive.title, "Dive into Python")
          self.assertEqual(dive.published, datetime.date(2009, 5, 4))
          self.assertRaises(Book.DoesNotExist, Book.objects.using('default').get, published__year=2009)
 
</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)) </s> remove         self.assertRaises(Book.DoesNotExist, Book.objects.using('default').get, published__year=2009)
 </s> add         with self.assertRaises(Book.DoesNotExist):
            Book.objects.using('default').get(published__year=2009) </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(AttributeError, dive.save)
 </s> add             with self.assertRaises(AttributeError):
                dive.save()
        with self.assertRaises(Book.DoesNotExist):
            Book.objects.using('default').get(title__iexact="dive INTO python")
          self.assertRaises(Book.DoesNotExist, Book.objects.using('default').get, title__icontains="dive")
  
          dive = Book.objects.using('other').get(title__iexact="dive INTO python")
          self.assertEqual(dive.title, "Dive into Python")
        with self.assertRaises(Book.DoesNotExist):
            Book.objects.using('default').get(title__iexact="dive INTO python")
  
          dive = Book.objects.using('other').get(published__year=2009)
          self.assertEqual(dive.title, "Dive into Python")
          self.assertEqual(dive.published, datetime.date(2009, 5, 4))
          self.assertRaises(Book.DoesNotExist, Book.objects.using('default').get, published__year=2009)
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