

def test_post_save_add_redirect(self):
    "\n        Ensures that ModelAdmin.response_post_save_add() controls the\n        redirection after the 'Save' button has been pressed when adding a\n        new object.\n        Refs 8001, 18310, 19505.\n        "
    post_data = {
        'name': 'John Doe',
    }
    self.assertEqual(Person.objects.count(), 0)
    response = self.client.post(reverse('admin_custom_urls:admin_custom_urls_person_add'), post_data)
    persons = Person.objects.all()
    self.assertEqual(len(persons), 1)
    redirect_url = reverse('admin_custom_urls:admin_custom_urls_person_history', args=[post_data[0].pk])
    self.assertRedirects(response, redirect_url)

dataset/ETHPy150Open django/django/tests/admin_custom_urls/tests.py AdminCustomUrlsTest.test_post_save_add_redirect/VarMisuse@85/213 `persons`->`post_data`