          request = self.rf.get('/slash')
          self.assertEqual(CommonMiddleware(get_response_404)(request).status_code, 404)
  
      @override_settings(APPEND_SLASH=True)
      def test_append_slash_quoted(self):
          """
          URLs which require quoting should be redirected to their slash version.
 
</s> remove             return (
                not is_valid_path(request.path_info, urlconf) and
                is_valid_path('%s/' % request.path_info, urlconf)
            )
 </s> add             if not is_valid_path(request.path_info, urlconf):
                match = is_valid_path('%s/' % request.path_info, urlconf)
                if match:
                    view = match.func
                    return getattr(view, 'should_append_slash', True) </s> remove         resolve(path, urlconf)
        return True
 </s> add         return resolve(path, urlconf) </s> remove     Return True if the given path resolves against the default URL resolver,
    False otherwise. This is a convenience method to make working with "is
    this a match?" cases easier, avoiding try...except blocks.
 </s> add     Return the ResolverMatch if the given path resolves against the default URL
    resolver, False otherwise. This is a convenience method to make working
    with "is this a match?" cases easier, avoiding try...except blocks.
    @override_settings(APPEND_SLASH=True)
    def test_append_slash_opt_out(self):
        """
        Views marked with @no_append_slash should be left alone.
        """
        request = self.rf.get('/sensitive_fbv')
        self.assertEqual(CommonMiddleware(get_response_404)(request).status_code, 404)

        request = self.rf.get('/sensitive_cbv')
        self.assertEqual(CommonMiddleware(get_response_404)(request).status_code, 404)

          request = self.rf.get('/slash')
          self.assertEqual(CommonMiddleware(get_response_404)(request).status_code, 404)
  
    @override_settings(APPEND_SLASH=True)
    def test_append_slash_opt_out(self):
        """
        Views marked with @no_append_slash should be left alone.
        """
        request = self.rf.get('/sensitive_fbv')
        self.assertEqual(CommonMiddleware(get_response_404)(request).status_code, 404)

        request = self.rf.get('/sensitive_cbv')
        self.assertEqual(CommonMiddleware(get_response_404)(request).status_code, 404)

      @override_settings(APPEND_SLASH=True)
      def test_append_slash_quoted(self):
          """
          URLs which require quoting should be redirected to their slash version.
keep keep add keep keep keep keep
 Fixed #32124 -- Added per-view opt-out for APPEND_SLASH behavior. 
tests/middleware/tests.py