@@ -1958,7 +1958,7 @@ def test_bulk_add_remove(self):
1958
1958
self .assertEqual (prev_record .places .all ().count (), 0 )
1959
1959
1960
1960
# Remove all places but the first
1961
- self .poll .places .remove (* Place .objects .filter ( id__gt = 1 ))
1961
+ self .poll .places .remove (* Place .objects .exclude ( pk = self . place . pk ))
1962
1962
1963
1963
self .assertEqual (self .poll .history .all ().count (), 3 )
1964
1964
@@ -2010,7 +2010,7 @@ def test_diff_against(self):
2010
2010
2011
2011
delta = add_record .diff_against (create_record )
2012
2012
expected_change = ModelChange (
2013
- "places" , [], [{"pollwithmanytomany" : 1 , "place" : 1 }]
2013
+ "places" , [], [{"pollwithmanytomany" : self . poll . pk , "place" : self . place . pk }]
2014
2014
)
2015
2015
self .assertEqual (delta .changed_fields , ["places" ])
2016
2016
self .assertEqual (delta .old_record , create_record )
@@ -2030,7 +2030,7 @@ def test_diff_against(self):
2030
2030
# Second and third should have the same diffs as first and second, but with
2031
2031
# old and new reversed
2032
2032
expected_change = ModelChange (
2033
- "places" , [{"place" : 1 , "pollwithmanytomany" : 1 }], []
2033
+ "places" , [{"place" : self . place . pk , "pollwithmanytomany" : self . poll . pk }], []
2034
2034
)
2035
2035
delta = del_record .diff_against (add_record )
2036
2036
self .assertEqual (delta .changed_fields , ["places" ])
0 commit comments