1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

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 9fa4d07ce0.
This commit is contained in:
Bendeguz Csirmaz
2025-01-10 08:44:10 +01:00
committed by Sarah Boyce
parent 9fa4d07ce0
commit 8287fd4915
2 changed files with 18 additions and 0 deletions

View File

@@ -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