(self)
| 230 | path("foo", EmptyCBV()) |
| 231 | |
| 232 | def test_whitespace_in_route(self): |
| 233 | msg = "URL route %r cannot contain whitespace in angle brackets <…>" |
| 234 | for whitespace in string.whitespace: |
| 235 | with self.subTest(repr(whitespace)): |
| 236 | route = "space/<int:num>/extra/<str:%stest>" % whitespace |
| 237 | with self.assertRaisesMessage(ImproperlyConfigured, msg % route): |
| 238 | path(route, empty_view) |
| 239 | # Whitespaces are valid in paths. |
| 240 | p = path("space%s/<int:num>/" % string.whitespace, empty_view) |
| 241 | match = p.resolve("space%s/1/" % string.whitespace) |
| 242 | self.assertEqual(match.kwargs, {"num": 1}) |
| 243 | |
| 244 | def test_path_trailing_newlines(self): |
| 245 | tests = [ |
nothing calls this directly
no test coverage detected