Ticket #24320: 24320-test.2.diff

File 24320-test.2.diff, 2.8 KB (added by Tim Graham, 9 years ago)
  • tests/serializers_regress/models.py

    diff --git a/tests/serializers_regress/models.py b/tests/serializers_regress/models.py
    index 3be5d6b..67cf0dd 100644
    a b class UUIDData(models.Model):  
    276276    data = models.UUIDField(primary_key=True)
    277277
    278278
     279class FKToUUID(models.Model):
     280    data = models.ForeignKey(UUIDData)
     281
     282
    279283class ComplexModel(models.Model):
    280284    field1 = models.CharField(max_length=10)
    281285    field2 = models.CharField(max_length=10)
  • tests/serializers_regress/tests.py

    diff --git a/tests/serializers_regress/tests.py b/tests/serializers_regress/tests.py
    index e00d68a..4432334 100644
    a b from .models import (  
    2828    BooleanData, BooleanPKData, CharData, CharPKData, ComplexModel, DateData,
    2929    DateTimeData, DecimalData, DecimalPKData, EmailData, EmailPKData,
    3030    ExplicitInheritBaseModel, FileData, FilePathData, FilePathPKData, FKData,
    31     FKDataNaturalKey, FKDataToField, FKDataToO2O, FKSelfData, FloatData,
    32     FloatPKData, GenericData, GenericIPAddressData, GenericIPAddressPKData,
    33     InheritAbstractModel, InheritBaseModel, IntegerData, IntegerPKData,
    34     Intermediate, LengthModel, M2MData, M2MIntermediateData, M2MSelfData,
    35     ModifyingSaveData, NaturalKeyAnchor, NullBooleanData, O2OData,
    36     PositiveIntegerData, PositiveIntegerPKData, PositiveSmallIntegerData,
    37     PositiveSmallIntegerPKData, ProxyBaseModel, ProxyProxyBaseModel, SlugData,
    38     SlugPKData, SmallData, SmallPKData, Tag, TextData, TimeData, UniqueAnchor,
    39     UUIDData,
     31    FKDataNaturalKey, FKDataToField, FKDataToO2O, FKSelfData, FKToUUID,
     32    FloatData, FloatPKData, GenericData, GenericIPAddressData,
     33    GenericIPAddressPKData, InheritAbstractModel, InheritBaseModel,
     34    IntegerData, IntegerPKData, Intermediate, LengthModel, M2MData,
     35    M2MIntermediateData, M2MSelfData, ModifyingSaveData, NaturalKeyAnchor,
     36    NullBooleanData, O2OData, PositiveIntegerData, PositiveIntegerPKData,
     37    PositiveSmallIntegerData, PositiveSmallIntegerPKData, ProxyBaseModel,
     38    ProxyProxyBaseModel, SlugData, SlugPKData, SmallData, SmallPKData, Tag,
     39    TextData, TimeData, UniqueAnchor, UUIDData,
    4040)
    4141
    4242try:
    im_obj = (im_create, im_compare)  
    201201o2o_obj = (o2o_create, o2o_compare)
    202202pk_obj = (pk_create, pk_compare)
    203203inherited_obj = (inherited_create, inherited_compare)
     204uuid1 = uuid.uuid4()
    204205
    205206test_data = [
    206207    # Format: (data type, PK value, Model Class, data)
    The end."""),  
    356357    # The end."""),
    357358    # (pk_obj, 770, TimePKData, datetime.time(10, 42, 37)),
    358359    # (pk_obj, 790, XMLPKData, "<foo></foo>"),
    359     (pk_obj, 791, UUIDData, uuid.uuid4()),
     360    (pk_obj, 791, UUIDData, uuid1),
     361    (fk_obj, 792, FKToUUID, uuid1),
    360362
    361363    (data_obj, 800, AutoNowDateTimeData, datetime.datetime(2006, 6, 16, 10, 42, 37)),
    362364    (data_obj, 810, ModifyingSaveData, 42),
Back to Top