summaryrefslogtreecommitdiff
path: root/tests/basic/models.py
diff options
context:
space:
mode:
authorBendeguz Csirmaz <csirmazbendeguz@gmail.com>2025-01-10 08:44:10 +0100
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-01-10 11:43:38 +0100
commit8287fd49151b1b99045efbf3de8ef911d63c5f45 (patch)
treeac8238b9808fe4eb09ef362a83d181affa9498db /tests/basic/models.py
parent9fa4d07ce0729850661a31a6b37c6b48f13d2266 (diff)
Refs #36064 -- Added test that falsey primary key default/db_default value skips an update query on save.
This adds test coverage for logic change in 9fa4d07ce0729850661a31a6b37c6b48f13d2266.
Diffstat (limited to 'tests/basic/models.py')
-rw-r--r--tests/basic/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/basic/models.py b/tests/basic/models.py
index 236884f4cc..1e6059ee88 100644
--- a/tests/basic/models.py
+++ b/tests/basic/models.py
@@ -57,5 +57,13 @@ class PrimaryKeyWithDbDefault(models.Model):
uuid = models.IntegerField(primary_key=True, db_default=1)
+class PrimaryKeyWithFalseyDefault(models.Model):
+ uuid = models.IntegerField(primary_key=True, default=0)
+
+
+class PrimaryKeyWithFalseyDbDefault(models.Model):
+ uuid = models.IntegerField(primary_key=True, db_default=0)
+
+
class ChildPrimaryKeyWithDefault(PrimaryKeyWithDefault):
pass