Fix passing force_insert parameter to Model.save()

Review Request #14839 — Created Feb. 19, 2026 and submitted

Information

Review Board
master

Reviewers

The BaseComment tests had a test case that was passing the
force_insert parameter to the model's save() method as a positional
argument, with a value of None. Django has changed this to deprecated
positional arguments entirely for this method, and also now raise a
TypeError if it's not passed as a bool. This change updates our test
to remove that parameter.

Ran unit tests.

Summary ID
Fix passing force_insert parameter to Model.save()
The BaseComment tests had a test case that was passing the `force_insert` parameter to the model's `save()` method as a positional argument, with a value of `None`. Django has changed this to deprecated positional arguments entirely for this method, and also now raise a `TypeError` if it's not passed as a bool. This change updates our test to remove that parameter. Testing Done: Ran unit tests.
sszwsntxnssrlwnvnzxnuyqpmpxmnqvn
Description From Last Updated

You can get rid of this and its corresponding check in self.assertSpyCalledWith. I had only added it to make sure …

maubinmaubin
maubin
  1. 
      
  2. Show all issues

    You can get rid of this and its corresponding check in self.assertSpyCalledWith. I had only added it to make sure that positional arguments get passed to the parent save method. We already test that custom keyword args get passed with update_fields. Plus the default value of force_insert is False anyways so this really isn't testing anything.

  3. 
      
david
david
maubin
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (fc666c8)