diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-12-08 20:58:59 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-12-08 21:08:37 +0100 |
| commit | fce779475e221e322a25dbf30dc25003e831afc2 (patch) | |
| tree | 3950703e31f707248a00c1ac5be55af04cb59747 /tests/modeltests/model_forms | |
| parent | c81e8e7068bdaa000ad6fbed8d452ac074ba19a9 (diff) | |
[1.5.x] Removed US localflavor-specific tests from core
Also fixes #9045.
Backport of 8248d1402 from master.
Diffstat (limited to 'tests/modeltests/model_forms')
| -rw-r--r-- | tests/modeltests/model_forms/models.py | 9 | ||||
| -rw-r--r-- | tests/modeltests/model_forms/tests.py | 14 |
2 files changed, 2 insertions, 21 deletions
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): </select></p> <p><label for="id_age">Age:</label> <input type="text" name="age" value="65" id="id_age" /></p>''' % (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. |
