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:
committed by
Sarah Boyce
parent
9fa4d07ce0
commit
8287fd4915
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user