|
13 | 13 |
|
14 | 14 |
|
15 | 15 | class FormMixinTests(TestCase): |
16 | | - def test_initial_data(self): |
17 | | - """ Test instance independence of initial data dict (see #16138) """ |
18 | | - initial_1 = FormMixin().get_initial() |
19 | | - initial_1['foo'] = 'bar' |
20 | | - initial_2 = FormMixin().get_initial() |
21 | | - self.assertNotEqual(initial_1, initial_2) |
| 16 | + def test_initial_data(self): |
| 17 | + """ Test instance independence of initial data dict (see #16138) """ |
| 18 | + initial_1 = FormMixin().get_initial() |
| 19 | + initial_1['foo'] = 'bar' |
| 20 | + initial_2 = FormMixin().get_initial() |
| 21 | + self.assertNotEqual(initial_1, initial_2) |
22 | 22 |
|
23 | 23 |
|
24 | 24 | class BasicFormTests(TestCase): |
@@ -283,6 +283,13 @@ def test_delete_with_redirect(self): |
283 | 283 | self.assertRedirects(res, 'http://testserver/edit/authors/create/') |
284 | 284 | self.assertQuerysetEqual(Author.objects.all(), []) |
285 | 285 |
|
| 286 | + def test_delete_with_interpolated_redirect(self): |
| 287 | + a = Author.objects.create(**{'name': 'Randall Munroe', 'slug': 'randall-munroe'}) |
| 288 | + res = self.client.post('/edit/author/%d/delete/interpolate_redirect/' % a.pk) |
| 289 | + self.assertEqual(res.status_code, 302) |
| 290 | + self.assertRedirects(res, 'http://testserver/edit/authors/create/?deleted=%d' % a.pk) |
| 291 | + self.assertQuerysetEqual(Author.objects.all(), []) |
| 292 | + |
286 | 293 | def test_delete_with_special_properties(self): |
287 | 294 | a = Author.objects.create(**{'name': 'Randall Munroe', 'slug': 'randall-munroe'}) |
288 | 295 | res = self.client.get('/edit/author/%d/delete/special/' % a.pk) |
|
0 commit comments