MCPcopy
hub / github.com/django/django / test_edit_save_as

Method test_edit_save_as

tests/admin_views/tests.py:630–648  ·  view source on GitHub ↗

Test "save as".

(self)

Source from the content-addressed store, hash-verified

628 self.assertEqual(response.status_code, 302) # redirect somewhere
629
630 def test_edit_save_as(self):
631 """
632 Test "save as".
633 """
634 post_data = self.inline_post_data.copy()
635 post_data.update(
636 {
637 "_saveasnew": "Save+as+new",
638 "article_set-1-section": "1",
639 "article_set-2-section": "1",
640 "article_set-3-section": "1",
641 "article_set-4-section": "1",
642 "article_set-5-section": "1",
643 }
644 )
645 response = self.client.post(
646 reverse("admin:admin_views_section_change", args=(self.s1.pk,)), post_data
647 )
648 self.assertEqual(response.status_code, 302) # redirect somewhere
649
650 def test_edit_save_as_delete_inline(self):
651 """

Callers

nothing calls this directly

Calls 4

reverseFunction · 0.90
copyMethod · 0.45
updateMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected