MCPcopy
hub / github.com/django/django / test_append_slash_opt_out

Method test_append_slash_opt_out

tests/middleware/tests.py:146–154  ·  view source on GitHub ↗

Views marked with @no_append_slash should be left alone.

(self)

Source from the content-addressed store, hash-verified

144
145 @override_settings(APPEND_SLASH=True)
146 def test_append_slash_opt_out(self):
147 """
148 Views marked with @no_append_slash should be left alone.
149 """
150 request = self.rf.get("/sensitive_fbv")
151 self.assertEqual(CommonMiddleware(get_response_404)(request).status_code, 404)
152
153 request = self.rf.get("/sensitive_cbv")
154 self.assertEqual(CommonMiddleware(get_response_404)(request).status_code, 404)
155
156 @override_settings(APPEND_SLASH=True)
157 def test_append_slash_quoted(self):

Callers

nothing calls this directly

Calls 2

CommonMiddlewareClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected