Fix passing force_insert parameter to Model.save()
Review Request #14839 — Created Feb. 19, 2026 and submitted
The BaseComment tests had a test case that was passing the
force_insertparameter to the model'ssave()method as a positional
argument, with a value ofNone. Django has changed this to deprecated
positional arguments entirely for this method, and also now raise a
TypeErrorif it's not passed as a bool. This change updates our test
to remove that parameter.
Ran unit tests.
| Summary | ID |
|---|---|
| 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 … |
|
-
-
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 withupdate_fields. Plus the default value offorce_insertisFalseanyways so this really isn't testing anything.
- Description:
-
The BaseComment tests had a test case that was passing the
force_insertparameter to the model'ssave()method as a positionalargument, with a value of None. Django has changed this to deprecatedpositional arguments entirely for this method, and also now raise a TypeErrorif it's not passed as a bool. This change updates our test~ to pass it as a kwarg with a value of False.~ to remove that parameter. + + Testing Done:
+ Ran unit tests. - Commits:
-
Summary ID sszwsntxnssrlwnvnzxnuyqpmpxmnqvn sszwsntxnssrlwnvnzxnuyqpmpxmnqvn
Checks run (2 succeeded)
- Description:
-
The BaseComment tests had a test case that was passing the
force_insertparameter to the model'ssave()method as a positionalargument, with a value of None. Django has changed this to deprecatedpositional arguments entirely for this method, and also now raise a TypeErrorif it's not passed as a bool. This change updates our testto remove that parameter. - - Testing Done:
- Ran unit tests.