Ticket #24320: 24320-test.diff

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

    diff --git a/tests/serializers_regress/models.py b/tests/serializers_regress/models.py
    index 35c4e10..86151ad 100644
    a b class SmallPKData(models.Model):  
    272272#    data = models.TimeField(primary_key=True)
    273273
    274274
     275class UUIDData(models.Model):
     276    data = models.UUIDField(primary_key=True)
     277
    275278class ComplexModel(models.Model):
    276279    field1 = models.CharField(max_length=10)
    277280    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 3653ffc..e00d68a 100644
    a b from __future__ import unicode_literals  
    1010
    1111import datetime
    1212import decimal
     13import uuid
    1314from unittest import skipUnless
    1415
    1516from django.core import serializers
    from .models import (  
    3536    PositiveIntegerData, PositiveIntegerPKData, PositiveSmallIntegerData,
    3637    PositiveSmallIntegerPKData, ProxyBaseModel, ProxyProxyBaseModel, SlugData,
    3738    SlugPKData, SmallData, SmallPKData, Tag, TextData, TimeData, UniqueAnchor,
     39    UUIDData,
    3840)
    3941
    4042try:
    The end."""),  
    354356    # The end."""),
    355357    # (pk_obj, 770, TimePKData, datetime.time(10, 42, 37)),
    356358    # (pk_obj, 790, XMLPKData, "<foo></foo>"),
     359    (pk_obj, 791, UUIDData, uuid.uuid4()),
    357360
    358361    (data_obj, 800, AutoNowDateTimeData, datetime.datetime(2006, 6, 16, 10, 42, 37)),
    359362    (data_obj, 810, ModifyingSaveData, 42),
Back to Top