mirror of https://github.com/django/django.git
[1.8.x] Added a test for UUIDField serialization; refs #24320.
Backport of d7509c5246
from master
This commit is contained in:
parent
7b5aa20a28
commit
8d1816db87
|
@ -280,6 +280,10 @@ class SmallPKData(models.Model):
|
||||||
# data = models.TimeField(primary_key=True)
|
# data = models.TimeField(primary_key=True)
|
||||||
|
|
||||||
|
|
||||||
|
class UUIDData(models.Model):
|
||||||
|
data = models.UUIDField(primary_key=True)
|
||||||
|
|
||||||
|
|
||||||
class ComplexModel(models.Model):
|
class ComplexModel(models.Model):
|
||||||
field1 = models.CharField(max_length=10)
|
field1 = models.CharField(max_length=10)
|
||||||
field2 = models.CharField(max_length=10)
|
field2 = models.CharField(max_length=10)
|
||||||
|
|
|
@ -10,6 +10,7 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import decimal
|
import decimal
|
||||||
|
import uuid
|
||||||
from unittest import skipUnless
|
from unittest import skipUnless
|
||||||
|
|
||||||
from django.core import serializers
|
from django.core import serializers
|
||||||
|
@ -36,7 +37,7 @@ from .models import (
|
||||||
NullBooleanData, O2OData, PositiveIntegerData, PositiveIntegerPKData,
|
NullBooleanData, O2OData, PositiveIntegerData, PositiveIntegerPKData,
|
||||||
PositiveSmallIntegerData, PositiveSmallIntegerPKData, ProxyBaseModel,
|
PositiveSmallIntegerData, PositiveSmallIntegerPKData, ProxyBaseModel,
|
||||||
ProxyProxyBaseModel, SlugData, SlugPKData, SmallData, SmallPKData, Tag,
|
ProxyProxyBaseModel, SlugData, SlugPKData, SmallData, SmallPKData, Tag,
|
||||||
TextData, TimeData, UniqueAnchor,
|
TextData, TimeData, UniqueAnchor, UUIDData,
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -360,6 +361,7 @@ The end."""),
|
||||||
# The end."""),
|
# The end."""),
|
||||||
# (pk_obj, 770, TimePKData, datetime.time(10, 42, 37)),
|
# (pk_obj, 770, TimePKData, datetime.time(10, 42, 37)),
|
||||||
# (pk_obj, 790, XMLPKData, "<foo></foo>"),
|
# (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, 800, AutoNowDateTimeData, datetime.datetime(2006, 6, 16, 10, 42, 37)),
|
||||||
(data_obj, 810, ModifyingSaveData, 42),
|
(data_obj, 810, ModifyingSaveData, 42),
|
||||||
|
|
Loading…
Reference in New Issue