From 38a5a23c327ab1c816dc56864002ecc66cac4a48 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 2 Jun 2017 13:33:44 -0400 Subject: [PATCH] Fixed admin_views test when run in reverse. Modifying self.s1 created in setUpTestData() leaked state. Regression in 45585d3cbbd320a316171b17474b60e3f5fb1fb8. --- tests/admin_views/tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index cb879a133d..48310b2929 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -3236,10 +3236,10 @@ class AdminActionsTest(TestCase): the objects selected for deletion are rendered without separators. Refs #14895. """ - self.s1.id = 9999 - self.s1.save() + new_pk = 9999 + ExternalSubscriber.objects.filter(id=self.s1.id).update(id=new_pk) action_data = { - ACTION_CHECKBOX_NAME: [self.s1.pk, self.s2.pk], + ACTION_CHECKBOX_NAME: [new_pk, self.s2.pk], 'action': 'delete_selected', 'index': 0, }