summaryrefslogtreecommitdiff
path: root/tests/basic/models.py
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2019-08-17 15:30:29 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-08-19 13:28:35 +0200
commit85458e94e38c20e57939947ee515a1a53689659f (patch)
tree8011012c857d0a8f462e55c4eb20913afb19657b /tests/basic/models.py
parente9f74f53ccbf897ed69a484f35d616e1914d2c90 (diff)
Fixed #29260 -- Skipped an UPDATE when adding a model instance with primary key that has a default.
Diffstat (limited to 'tests/basic/models.py')
-rw-r--r--tests/basic/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/basic/models.py b/tests/basic/models.py
index 40de6ae7de..7b2b1aee54 100644
--- a/tests/basic/models.py
+++ b/tests/basic/models.py
@@ -3,6 +3,8 @@ Bare-bones model
This is a basic model with only two non-primary-key fields.
"""
+import uuid
+
from django.db import models
@@ -40,3 +42,7 @@ class SelfRef(models.Model):
# This method intentionally doesn't work for all cases - part
# of the test for ticket #20278
return SelfRef.objects.get(selfref=self).pk
+
+
+class PrimaryKeyWithDefault(models.Model):
+ uuid = models.UUIDField(primary_key=True, default=uuid.uuid4)