(self)
| 9396 | self.assertIsNone(model_admin.get_view_on_site_url(Worker())) |
| 9397 | |
| 9398 | def test_custom_admin_site(self): |
| 9399 | model_admin = ModelAdmin(City, customadmin.site) |
| 9400 | content_type_pk = ContentType.objects.get_for_model(City).pk |
| 9401 | redirect_url = model_admin.get_view_on_site_url(self.c1) |
| 9402 | self.assertEqual( |
| 9403 | redirect_url, |
| 9404 | reverse( |
| 9405 | f"{customadmin.site.name}:view_on_site", |
| 9406 | kwargs={ |
| 9407 | "content_type_id": content_type_pk, |
| 9408 | "object_id": self.c1.pk, |
| 9409 | }, |
| 9410 | ), |
| 9411 | ) |
| 9412 | |
| 9413 | def test_view_on_site_url_non_integer_ids(self): |
| 9414 | """The view_on_site URL accepts non-integer ids.""" |
nothing calls this directly
no test coverage detected