          self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
          self.assertEqual(detail, self.custom_message)
  
      def test_permission_denied_for_object(self):
          response = denied_object_view(self.request, pk=1)
          detail = response.data.get('detail')
 
</s>
        self.assertEqual(detail.code, self.custom_code)
          self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
          self.assertEqual(detail, self.custom_message)
        self.assertEqual(detail.code, self.custom_code)
  
      def test_permission_denied_for_object(self):
          response = denied_object_view(self.request, pk=1)
          detail = response.data.get('detail')
keep add keep keep keep keep
 Pass custom code to PermissionDenied if permission class had one set (#7306)
tests/test_permissions.py