From 8248d1402982041490b5d6bb45514ffdba0e18d3 Mon Sep 17 00:00:00 2001
From: Claude Paroz
''' % (w_woodward.pk, w_bernstein.pk, bw.pk, w_royko.pk)) - def test_phone_number_field(self): - f = PhoneNumberForm({'phone': '(312) 555-1212', 'description': 'Assistance'}) - self.assertEqual(f.is_valid(), True) - self.assertEqual(f.cleaned_data['phone'], '312-555-1212') - self.assertEqual(f.cleaned_data['description'], 'Assistance') - def test_file_field(self): # Test conditions when files is either not given or empty. diff --git a/tests/regressiontests/serializers_regress/models.py b/tests/regressiontests/serializers_regress/models.py index 52223e72d8..af261f9cbc 100644 --- a/tests/regressiontests/serializers_regress/models.py +++ b/tests/regressiontests/serializers_regress/models.py @@ -8,7 +8,6 @@ This class sets up a model for each model field type from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType -from django.contrib.localflavor.us.models import USStateField, PhoneNumberField # The following classes are for testing basic data # marshalling, including NULL values, where allowed. @@ -58,9 +57,6 @@ class GenericIPAddressData(models.Model): class NullBooleanData(models.Model): data = models.NullBooleanField(null=True) -class PhoneData(models.Model): - data = PhoneNumberField(null=True) - class PositiveIntegerData(models.Model): data = models.PositiveIntegerField(null=True) @@ -79,9 +75,6 @@ class TextData(models.Model): class TimeData(models.Model): data = models.TimeField(null=True) -class USStateData(models.Model): - data = USStateField(null=True) - class Tag(models.Model): """A tag on an item.""" data = models.SlugField() @@ -212,9 +205,6 @@ class GenericIPAddressPKData(models.Model): # class NullBooleanPKData(models.Model): # data = models.NullBooleanField(primary_key=True) -class PhonePKData(models.Model): - data = PhoneNumberField(primary_key=True) - class PositiveIntegerPKData(models.Model): data = models.PositiveIntegerField(primary_key=True) @@ -233,9 +223,6 @@ class SmallPKData(models.Model): # class TimePKData(models.Model): # data = models.TimeField(primary_key=True) -class USStatePKData(models.Model): - data = USStateField(primary_key=True) - class ComplexModel(models.Model): field1 = models.CharField(max_length=10) field2 = models.CharField(max_length=10) diff --git a/tests/regressiontests/serializers_regress/tests.py b/tests/regressiontests/serializers_regress/tests.py index f4b3adaa5e..2583a1ea04 100644 --- a/tests/regressiontests/serializers_regress/tests.py +++ b/tests/regressiontests/serializers_regress/tests.py @@ -28,14 +28,14 @@ from django.utils.unittest import skipUnless from .models import (BooleanData, CharData, DateData, DateTimeData, EmailData, FileData, FilePathData, DecimalData, FloatData, IntegerData, IPAddressData, - GenericIPAddressData, NullBooleanData, PhoneData, PositiveIntegerData, + GenericIPAddressData, NullBooleanData, PositiveIntegerData, PositiveSmallIntegerData, SlugData, SmallData, TextData, TimeData, - USStateData, GenericData, Anchor, UniqueAnchor, FKData, M2MData, O2OData, + GenericData, Anchor, UniqueAnchor, FKData, M2MData, O2OData, FKSelfData, M2MSelfData, FKDataToField, FKDataToO2O, M2MIntermediateData, Intermediate, BooleanPKData, CharPKData, EmailPKData, FilePathPKData, DecimalPKData, FloatPKData, IntegerPKData, IPAddressPKData, - GenericIPAddressPKData, PhonePKData, PositiveIntegerPKData, - PositiveSmallIntegerPKData, SlugPKData, SmallPKData, USStatePKData, + GenericIPAddressPKData, PositiveIntegerPKData, + PositiveSmallIntegerPKData, SlugPKData, SmallPKData, AutoNowDateTimeData, ModifyingSaveData, InheritAbstractModel, BaseModel, ExplicitInheritBaseModel, InheritBaseModel, ProxyBaseModel, ProxyProxyBaseModel, BigIntegerData, LengthModel, Tag, ComplexModel, @@ -218,8 +218,6 @@ test_data = [ (data_obj, 100, NullBooleanData, True), (data_obj, 101, NullBooleanData, False), (data_obj, 102, NullBooleanData, None), - (data_obj, 110, PhoneData, "212-634-5789"), - (data_obj, 111, PhoneData, None), (data_obj, 120, PositiveIntegerData, 123456789), (data_obj, 121, PositiveIntegerData, None), (data_obj, 130, PositiveSmallIntegerData, 12), @@ -239,9 +237,6 @@ The end."""), (data_obj, 162, TextData, None), (data_obj, 170, TimeData, datetime.time(10,42,37)), (data_obj, 171, TimeData, None), - (data_obj, 180, USStateData, "MA"), - (data_obj, 181, USStateData, None), - (data_obj, 182, USStateData, ""), (generic_obj, 200, GenericData, ['Generic Object 1', 'tag1', 'tag2']), (generic_obj, 201, GenericData, ['Generic Object 2', 'tag2', 'tag3']), @@ -320,7 +315,6 @@ The end."""), (pk_obj, 695, GenericIPAddressPKData, "fe80:1424:2223:6cff:fe8a:2e8a:2151:abcd"), # (pk_obj, 700, NullBooleanPKData, True), # (pk_obj, 701, NullBooleanPKData, False), - (pk_obj, 710, PhonePKData, "212-634-5789"), (pk_obj, 720, PositiveIntegerPKData, 123456789), (pk_obj, 730, PositiveSmallIntegerPKData, 12), (pk_obj, 740, SlugPKData, "this-is-a-slug"), @@ -332,7 +326,6 @@ The end."""), # Several of them. # The end."""), # (pk_obj, 770, TimePKData, datetime.time(10,42,37)), - (pk_obj, 780, USStatePKData, "MA"), # (pk_obj, 790, XMLPKData, "