summaryrefslogtreecommitdiff
path: root/tests/regressiontests/model_forms_regress/tests.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2010-12-04 07:28:12 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2010-12-04 07:28:12 +0000
commit5bc0ec4ec4b7c888a291bc81b2edd72812231d96 (patch)
treebf3bec9ab44f1847ed2076167039e763011ea1cd /tests/regressiontests/model_forms_regress/tests.py
parent6770c3626271569da41053c1cfd37f7128f1457f (diff)
downloaddjango-5bc0ec4ec4b7c888a291bc81b2edd72812231d96.tar.gz
Removed all usages of deprecated TestCase methods (self.fail*). This removed most of the Warnings emitted (with -Wall) during the test suite.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/model_forms_regress/tests.py')
-rw-r--r--tests/regressiontests/model_forms_regress/tests.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/regressiontests/model_forms_regress/tests.py b/tests/regressiontests/model_forms_regress/tests.py
index 4a88ce4800..e38df4a80f 100644
--- a/tests/regressiontests/model_forms_regress/tests.py
+++ b/tests/regressiontests/model_forms_regress/tests.py
@@ -1,11 +1,12 @@
-import unittest
from datetime import date
from django import forms
-from django.forms.models import modelform_factory, ModelChoiceField, fields_for_model, construct_instance
-from django.test import TestCase
from django.core.exceptions import FieldError, ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
+from django.forms.models import (modelform_factory, ModelChoiceField,
+ fields_for_model, construct_instance)
+from django.utils import unittest
+from django.test import TestCase
from models import Person, RealPerson, Triple, FilePathModel, Article, \
Publication, CustomFF, Author, Author1, Homepage, Document, Edition
@@ -38,10 +39,10 @@ class UniqueTogetherTests(TestCase):
Triple.objects.create(left=1, middle=2, right=3)
form = TripleForm({'left': '1', 'middle': '2', 'right': '3'})
- self.failIf(form.is_valid())
+ self.assertFalse(form.is_valid())
form = TripleForm({'left': '1', 'middle': '3', 'right': '1'})
- self.failUnless(form.is_valid())
+ self.assertTrue(form.is_valid())
class TripleFormWithCleanOverride(forms.ModelForm):
class Meta:
@@ -59,7 +60,7 @@ class OverrideCleanTests(TestCase):
optional.
"""
form = TripleFormWithCleanOverride({'left': 1, 'middle': 2, 'right': 1})
- self.failUnless(form.is_valid())
+ self.assertTrue(form.is_valid())
# form.instance.left will be None if the instance was not constructed
# by form.full_clean().
self.assertEquals(form.instance.left, 1)