Refs #21286 -- Enabled serializer tests with date/datetime pk model

This commit is contained in:
Claude Paroz 2017-06-05 18:59:22 +02:00
parent 5a52d932ef
commit d02fc8dfd3
2 changed files with 19 additions and 16 deletions

View File

@ -188,11 +188,13 @@ class BooleanPKData(models.Model):
class CharPKData(models.Model): class CharPKData(models.Model):
data = models.CharField(max_length=30, primary_key=True) data = models.CharField(max_length=30, primary_key=True)
# class DatePKData(models.Model):
# data = models.DateField(primary_key=True)
# class DateTimePKData(models.Model): class DatePKData(models.Model):
# data = models.DateTimeField(primary_key=True) data = models.DateField(primary_key=True)
class DateTimePKData(models.Model):
data = models.DateTimeField(primary_key=True)
class DecimalPKData(models.Model): class DecimalPKData(models.Model):

View File

@ -16,16 +16,17 @@ from django.test import TestCase
from .models import ( from .models import (
Anchor, AutoNowDateTimeData, BigIntegerData, BinaryData, BooleanData, Anchor, AutoNowDateTimeData, BigIntegerData, BinaryData, BooleanData,
BooleanPKData, CharData, CharPKData, DateData, DateTimeData, DecimalData, BooleanPKData, CharData, CharPKData, DateData, DatePKData, DateTimeData,
DecimalPKData, EmailData, EmailPKData, ExplicitInheritBaseModel, FileData, DateTimePKData, DecimalData, DecimalPKData, EmailData, EmailPKData,
FilePathData, FilePathPKData, FKData, FKDataToField, FKDataToO2O, ExplicitInheritBaseModel, FileData, FilePathData, FilePathPKData, FKData,
FKSelfData, FKToUUID, FloatData, FloatPKData, GenericData, FKDataToField, FKDataToO2O, FKSelfData, FKToUUID, FloatData, FloatPKData,
GenericIPAddressData, GenericIPAddressPKData, InheritAbstractModel, GenericData, GenericIPAddressData, GenericIPAddressPKData,
InheritBaseModel, IntegerData, IntegerPKData, Intermediate, LengthModel, InheritAbstractModel, InheritBaseModel, IntegerData, IntegerPKData,
M2MData, M2MIntermediateData, M2MSelfData, ModifyingSaveData, Intermediate, LengthModel, M2MData, M2MIntermediateData, M2MSelfData,
NullBooleanData, O2OData, PositiveIntegerData, PositiveIntegerPKData, ModifyingSaveData, NullBooleanData, O2OData, PositiveIntegerData,
PositiveSmallIntegerData, PositiveSmallIntegerPKData, SlugData, SlugPKData, PositiveIntegerPKData, PositiveSmallIntegerData,
SmallData, SmallPKData, Tag, TextData, TimeData, UniqueAnchor, UUIDData, PositiveSmallIntegerPKData, SlugData, SlugPKData, SmallData, SmallPKData,
Tag, TextData, TimeData, UniqueAnchor, UUIDData,
) )
from .tests import register_tests from .tests import register_tests
@ -317,8 +318,8 @@ The end."""),
(pk_obj, 601, BooleanPKData, True), (pk_obj, 601, BooleanPKData, True),
(pk_obj, 602, BooleanPKData, False), (pk_obj, 602, BooleanPKData, False),
(pk_obj, 610, CharPKData, "Test Char PKData"), (pk_obj, 610, CharPKData, "Test Char PKData"),
# (pk_obj, 620, DatePKData, datetime.date(2006, 6, 16)), (pk_obj, 620, DatePKData, datetime.date(2006, 6, 16)),
# (pk_obj, 630, DateTimePKData, datetime.datetime(2006, 6, 16, 10, 42, 37)), (pk_obj, 630, DateTimePKData, datetime.datetime(2006, 6, 16, 10, 42, 37)),
(pk_obj, 640, EmailPKData, "hovercraft@example.com"), (pk_obj, 640, EmailPKData, "hovercraft@example.com"),
# (pk_obj, 650, FilePKData, 'file:///foo/bar/whiz.txt'), # (pk_obj, 650, FilePKData, 'file:///foo/bar/whiz.txt'),
(pk_obj, 660, FilePathPKData, "/foo/bar/whiz.txt"), (pk_obj, 660, FilePathPKData, "/foo/bar/whiz.txt"),