          BasicModel(text='foo').save()
          User.objects.create_user('username', 'username@example.com', 'password')
          credentials = basic_auth_header('username', 'password')
          self.request = factory.get('/1', format='json', HTTP_AUTHORIZATION=credentials)
          self.custom_message = 'Custom: You cannot post to this resource'
  
      def test_permission_denied(self):
              response = denied_view(self.request, pk=1)
              detail = response.data.get('detail')
              self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
 
</s> remove     message = 'Custom: You cannot post to this resource'
 </s> add     message = 'Custom: You cannot access this resource' </s> remove     message = 'Custom: You cannot post to this resource'
 </s> add     message = 'Custom: You cannot access this resource'
        self.custom_message = 'Custom: You cannot access this resource'
          BasicModel(text='foo').save()
          User.objects.create_user('username', 'username@example.com', 'password')
          credentials = basic_auth_header('username', 'password')
          self.request = factory.get('/1', format='json', HTTP_AUTHORIZATION=credentials)
        self.custom_message = 'Custom: You cannot access this resource'
  
      def test_permission_denied(self):
              response = denied_view(self.request, pk=1)
              detail = response.data.get('detail')
              self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
keep keep keep keep replace keep keep keep keep keep
 change custom message for clarity 
tests/test_permissions.py