From e57eba8410a9a2ce8dfec4f4c279be0fc98279ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ni=20Gauffier?= Date: Tue, 14 Jun 2022 11:19:52 +0200 Subject: [PATCH] fix tests --- simple_history/tests/tests/test_models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simple_history/tests/tests/test_models.py b/simple_history/tests/tests/test_models.py index 67c7f5e30..2e3d4b930 100644 --- a/simple_history/tests/tests/test_models.py +++ b/simple_history/tests/tests/test_models.py @@ -1958,7 +1958,7 @@ def test_bulk_add_remove(self): self.assertEqual(prev_record.places.all().count(), 0) # Remove all places but the first - self.poll.places.remove(*Place.objects.filter(id__gt=1)) + self.poll.places.remove(*Place.objects.exclude(pk=self.place.pk)) self.assertEqual(self.poll.history.all().count(), 3) @@ -2010,7 +2010,7 @@ def test_diff_against(self): delta = add_record.diff_against(create_record) expected_change = ModelChange( - "places", [], [{"pollwithmanytomany": 1, "place": 1}] + "places", [], [{"pollwithmanytomany": self.poll.pk, "place": self.place.pk}] ) self.assertEqual(delta.changed_fields, ["places"]) self.assertEqual(delta.old_record, create_record) @@ -2030,7 +2030,7 @@ def test_diff_against(self): # Second and third should have the same diffs as first and second, but with # old and new reversed expected_change = ModelChange( - "places", [{"place": 1, "pollwithmanytomany": 1}], [] + "places", [{"place": self.place.pk, "pollwithmanytomany": self.poll.pk}], [] ) delta = del_record.diff_against(add_record) self.assertEqual(delta.changed_fields, ["places"])