                  manager = getattr(Person, manager_name)
                  # Methods with queryset_only=False are copied even if they are private.
                  manager._optin_private_method()
                  # Methods with queryset_only=True aren't copied even if they are public.
                  with self.assertRaises(AttributeError):
                      manager.optout_public_method()
  
      def test_manager_use_queryset_methods(self):
          """
          Custom manager will use the queryset methods
 
</s> remove         with self.assertRaises(AttributeError):
 </s> add         msg = "'CustomQuerySet' object has no attribute 'manager_only'"
        with self.assertRaisesMessage(AttributeError, msg): </s> remove         with self.assertRaises(DatabaseError):
 </s> add         msg = 'Forced update did not affect any rows.'
        with self.assertRaisesMessage(DatabaseError, msg): </s> remove         with self.assertRaises(AttributeError):
 </s> add         msg = "type object 'Book' has no attribute 'objects'"
        with self.assertRaisesMessage(AttributeError, msg): </s> remove         with self.assertRaises(IntegrityError):
 </s> add         msg = (
            "Cannot delete some instances of model 'R' because they are "
            "referenced through a protected foreign key: 'A.protect'"
        )
        with self.assertRaisesMessage(IntegrityError, msg): </s> remove         with self.assertRaises(AttributeError):
 </s> add         with self.assertRaisesMessage(AttributeError, "'Employee' object has no attribute 'id'"):
                msg = "%r object has no attribute 'optout_public_method'" % manager.__class__.__name__
                with self.assertRaisesMessage(AttributeError, msg):
                  manager = getattr(Person, manager_name)
                  # Methods with queryset_only=False are copied even if they are private.
                  manager._optin_private_method()
                  # Methods with queryset_only=True aren't copied even if they are public.
                msg = "%r object has no attribute 'optout_public_method'" % manager.__class__.__name__
                with self.assertRaisesMessage(AttributeError, msg):
                      manager.optout_public_method()
  
      def test_manager_use_queryset_methods(self):
          """
          Custom manager will use the queryset methods
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/custom_managers/tests.py