summaryrefslogtreecommitdiff
path: root/tests/contenttypes_tests/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/contenttypes_tests/models.py')
-rw-r--r--tests/contenttypes_tests/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/contenttypes_tests/models.py b/tests/contenttypes_tests/models.py
index 5e40217c30..90a928fc2f 100644
--- a/tests/contenttypes_tests/models.py
+++ b/tests/contenttypes_tests/models.py
@@ -1,3 +1,4 @@
+import uuid
from urllib.parse import quote
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
@@ -112,3 +113,10 @@ class ModelWithM2MToSite(models.Model):
def get_absolute_url(self):
return "/title/%s/" % quote(self.title)
+
+
+class UUIDModel(models.Model):
+ id = models.UUIDField(primary_key=True, default=uuid.uuid4)
+
+ def get_absolute_url(self):
+ return "/uuid/%s/" % self.pk