diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt index fcc9bd6a7f..233346db0d 100644 --- a/docs/topics/forms/modelforms.txt +++ b/docs/topics/forms/modelforms.txt @@ -90,9 +90,6 @@ Model field Form field ``NullBooleanField`` ``CharField`` -``PhoneNumberField`` ``USPhoneNumberField`` - (from ``django.contrib.localflavor.us``) - ``PositiveIntegerField`` ``IntegerField`` ``PositiveSmallIntegerField`` ``IntegerField`` diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py index 90b019b611..132da2d318 100644 --- a/tests/modeltests/model_forms/models.py +++ b/tests/modeltests/model_forms/models.py @@ -91,15 +91,6 @@ class WriterProfile(models.Model): def __str__(self): return "%s is %s" % (self.writer, self.age) -from django.contrib.localflavor.us.models import PhoneNumberField -@python_2_unicode_compatible -class PhoneNumber(models.Model): - phone = PhoneNumberField() - description = models.CharField(max_length=20) - - def __str__(self): - return self.phone - @python_2_unicode_compatible class TextFile(models.Model): description = models.CharField(max_length=20) diff --git a/tests/modeltests/model_forms/tests.py b/tests/modeltests/model_forms/tests.py index c008c00906..47d72abdc2 100644 --- a/tests/modeltests/model_forms/tests.py +++ b/tests/modeltests/model_forms/tests.py @@ -18,7 +18,7 @@ from django.utils import six from .models import (Article, ArticleStatus, BetterWriter, BigInt, Book, Category, CommaSeparatedInteger, CustomFieldForExclusionModel, DerivedBook, DerivedPost, ExplicitPK, FlexibleDatePost, ImprovedArticle, - ImprovedArticleWithParentLink, Inventory, PhoneNumber, Post, Price, + ImprovedArticleWithParentLink, Inventory, Post, Price, Product, TextFile, Writer, WriterProfile, test_images) if test_images: @@ -148,10 +148,6 @@ class WriterProfileForm(forms.ModelForm): class Meta: model = WriterProfile -class PhoneNumberForm(forms.ModelForm): - class Meta: - model = PhoneNumber - class TextFileForm(forms.ModelForm): class Meta: model = TextFile @@ -167,7 +163,7 @@ class ModelFormWithMedia(forms.ModelForm): 'all': ('/some/form/css',) } class Meta: - model = PhoneNumber + model = TextFile class CommaSeparatedIntegerForm(forms.ModelForm): class Meta: @@ -1149,12 +1145,6 @@ class OldFormForXTests(TestCase):

''' % (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, ""), (data_obj, 800, AutoNowDateTimeData, datetime.datetime(2006,6,16,10,42,37)),