From ade54ffa34ddc6c19b26c6ea72b46f73af7b682b Mon Sep 17 00:00:00 2001 From: Alexander Gaevsky Date: Thu, 7 Jan 2016 11:07:15 +0200 Subject: Refs #25165 -- Fixed JSON serialization for add/edit popup in the admin. Forwardport of test in o839d71d8562abe0b245024e55ca1d02a45e58fd from stable/1.9.x (refs #25997). --- tests/admin_views/models.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/admin_views/models.py') diff --git a/tests/admin_views/models.py b/tests/admin_views/models.py index aa4476c9ed..5411885ee9 100644 --- a/tests/admin_views/models.py +++ b/tests/admin_views/models.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import datetime import os import tempfile +import uuid from django.contrib.auth.models import User from django.contrib.contenttypes.fields import ( @@ -956,3 +957,15 @@ class ReferencedByGenRel(models.Model): class GenRelReference(models.Model): references = GenericRelation(ReferencedByGenRel) + + +class ParentWithUUIDPK(models.Model): + id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) + title = models.CharField(max_length=100) + + def __str__(self): + return str(self.id) + + +class RelatedWithUUIDPKModel(models.Model): + parent = models.ForeignKey(ParentWithUUIDPK, on_delete=models.CASCADE) -- cgit v1.3