GET on the change_view (when passing a string as the PK argument for a model with an integer PK field) redirects to the index page with a message saying the object doesn't exist.
(self)
| 406 | self.assertEqual(response.status_code, 200) |
| 407 | |
| 408 | def test_basic_edit_GET_string_PK(self): |
| 409 | """ |
| 410 | GET on the change_view (when passing a string as the PK argument for a |
| 411 | model with an integer PK field) redirects to the index page with a |
| 412 | message saying the object doesn't exist. |
| 413 | """ |
| 414 | response = self.client.get( |
| 415 | reverse("admin:admin_views_section_change", args=(quote("abc/<b>"),)), |
| 416 | follow=True, |
| 417 | ) |
| 418 | self.assertRedirects(response, reverse("admin:index")) |
| 419 | self.assertEqual( |
| 420 | [m.message for m in response.context["messages"]], |
| 421 | ["section with ID “abc/<b>” doesn’t exist. Perhaps it was deleted?"], |
| 422 | ) |
| 423 | |
| 424 | def test_basic_edit_GET_old_url_redirect(self): |
| 425 | """ |
nothing calls this directly
no test coverage detected