| 453 | |
| 454 | def test_url_conflicts_with_add(self): |
| 455 | "A model with a primary key that ends with add should be visible" |
| 456 | add_model = ModelWithStringPrimaryKey(id="i have something to add") |
| 457 | add_model.save() |
| 458 | response = self.client.get('/test_admin/admin/admin_views/modelwithstringprimarykey/%s/' % quote(add_model.pk)) |
| 459 | should_contain = """<h1>Change model with string primary key</h1>""" |
| 460 | self.assertContains(response, should_contain) |
| 461 | |
| 462 | def test_url_conflicts_with_delete(self): |
| 463 | "A model with a primary key that ends with delete should be visible" |
| 464 | delete_model = ModelWithStringPrimaryKey(id="delete") |
| 465 | delete_model.save() |
| 466 | response = self.client.get('/test_admin/admin/admin_views/modelwithstringprimarykey/%s/' % quote(delete_model.pk)) |
| 467 | should_contain = """<h1>Change model with string primary key</h1>""" |
| 468 | self.assertContains(response, should_contain) |
| 469 | |
| 470 | def test_url_conflicts_with_history(self): |
| 471 | "A model with a primary key that ends with history should be visible" |
| 472 | history_model = ModelWithStringPrimaryKey(id="history") |
| 473 | history_model.save() |
| 474 | response = self.client.get('/test_admin/admin/admin_views/modelwithstringprimarykey/%s/' % quote(history_model.pk)) |
| 475 | should_contain = """<h1>Change model with string primary key</h1>""" |
| 476 | self.assertContains(response, should_contain) |
| 477 | |