[1.8.x] Added a test for UUIDField serialization; refs #24320.

Backport of d7509c5246 from master
This commit is contained in:
Tim Graham 2015-02-12 09:54:42 -05:00
parent 7b5aa20a28
commit 8d1816db87
2 changed files with 7 additions and 1 deletions

View File

@ -280,6 +280,10 @@ class SmallPKData(models.Model):
# data = models.TimeField(primary_key=True)
class UUIDData(models.Model):
data = models.UUIDField(primary_key=True)
class ComplexModel(models.Model):
field1 = models.CharField(max_length=10)
field2 = models.CharField(max_length=10)

View File

@ -10,6 +10,7 @@ from __future__ import unicode_literals
import datetime
import decimal
import uuid
from unittest import skipUnless
from django.core import serializers
@ -36,7 +37,7 @@ from .models import (
NullBooleanData, O2OData, PositiveIntegerData, PositiveIntegerPKData,
PositiveSmallIntegerData, PositiveSmallIntegerPKData, ProxyBaseModel,
ProxyProxyBaseModel, SlugData, SlugPKData, SmallData, SmallPKData, Tag,
TextData, TimeData, UniqueAnchor,
TextData, TimeData, UniqueAnchor, UUIDData,
)
try:
@ -360,6 +361,7 @@ The end."""),
# The end."""),
# (pk_obj, 770, TimePKData, datetime.time(10, 42, 37)),
# (pk_obj, 790, XMLPKData, "<foo></foo>"),
(pk_obj, 791, UUIDData, uuid.uuid4()),
(data_obj, 800, AutoNowDateTimeData, datetime.datetime(2006, 6, 16, 10, 42, 37)),
(data_obj, 810, ModifyingSaveData, 42),