diff options
Diffstat (limited to 'tests/forms_tests')
| -rw-r--r-- | tests/forms_tests/tests/test_error_messages.py | 4 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_forms.py | 4 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_formsets.py | 10 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_media.py | 6 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_utils.py | 4 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_widgets.py | 12 | ||||
| -rw-r--r-- | tests/forms_tests/tests/tests.py | 4 |
7 files changed, 22 insertions, 22 deletions
diff --git a/tests/forms_tests/tests/test_error_messages.py b/tests/forms_tests/tests/test_error_messages.py index c02a44f8ff..d2a80051ce 100644 --- a/tests/forms_tests/tests/test_error_messages.py +++ b/tests/forms_tests/tests/test_error_messages.py @@ -9,7 +9,7 @@ from django.forms import ( ModelMultipleChoiceField, MultipleChoiceField, RegexField, SplitDateTimeField, TimeField, URLField, ValidationError, utils, ) -from django.test import TestCase +from django.test import SimpleTestCase, TestCase from django.utils.encoding import python_2_unicode_compatible from django.utils.safestring import mark_safe @@ -23,7 +23,7 @@ class AssertFormErrorsMixin(object): self.assertEqual(e.messages, expected) -class FormsErrorMessagesTestCase(TestCase, AssertFormErrorsMixin): +class FormsErrorMessagesTestCase(SimpleTestCase, AssertFormErrorsMixin): def test_charfield(self): e = { 'required': 'REQUIRED', diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py index 940a55feda..056dbad296 100644 --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -20,7 +20,7 @@ from django.forms import ( from django.forms.utils import ErrorList from django.http import QueryDict from django.template import Context, Template -from django.test import TestCase +from django.test import SimpleTestCase from django.test.utils import str_prefix from django.utils import six from django.utils.datastructures import MultiValueDict @@ -41,7 +41,7 @@ class PersonNew(Form): birthday = DateField() -class FormsTestCase(TestCase): +class FormsTestCase(SimpleTestCase): # A Form is a collection of Fields. It knows how to validate a set of data and it # knows how to render itself in a couple of default ways (e.g., an HTML table). # You can pass it data in __init__(), as a dictionary. diff --git a/tests/forms_tests/tests/test_formsets.py b/tests/forms_tests/tests/test_formsets.py index 9285a83038..0bd28111e1 100644 --- a/tests/forms_tests/tests/test_formsets.py +++ b/tests/forms_tests/tests/test_formsets.py @@ -9,7 +9,7 @@ from django.forms import ( ) from django.forms.formsets import BaseFormSet, formset_factory from django.forms.utils import ErrorList -from django.test import TestCase +from django.test import SimpleTestCase from django.utils.encoding import force_text @@ -57,7 +57,7 @@ class SplitDateTimeForm(Form): SplitDateTimeFormSet = formset_factory(SplitDateTimeForm) -class FormsFormsetTestCase(TestCase): +class FormsFormsetTestCase(SimpleTestCase): def make_choiceformset(self, formset_data=None, formset_class=ChoiceFormSet, total_forms=None, initial_forms=0, max_num_forms=0, min_num_forms=0, **kwargs): @@ -1117,7 +1117,7 @@ class Choice(Form): ChoiceFormSet = formset_factory(Choice) -class FormsetAsFooTests(TestCase): +class FormsetAsFooTests(SimpleTestCase): def test_as_table(self): formset = ChoiceFormSet(data, auto_id=False, prefix='choices') self.assertHTMLEqual(formset.as_table(), """<input type="hidden" name="choices-TOTAL_FORMS" value="1" /><input type="hidden" name="choices-INITIAL_FORMS" value="0" /><input type="hidden" name="choices-MIN_NUM_FORMS" value="0" /><input type="hidden" name="choices-MAX_NUM_FORMS" value="0" /> @@ -1145,7 +1145,7 @@ class ArticleForm(Form): ArticleFormSet = formset_factory(ArticleForm) -class TestIsBoundBehavior(TestCase): +class TestIsBoundBehavior(SimpleTestCase): def test_no_data_raises_validation_error(self): with self.assertRaises(ValidationError): ArticleFormSet({}).is_valid() @@ -1200,7 +1200,7 @@ class TestIsBoundBehavior(TestCase): self.assertHTMLEqual(empty_forms[0].as_p(), empty_forms[1].as_p()) -class TestEmptyFormSet(TestCase): +class TestEmptyFormSet(SimpleTestCase): def test_empty_formset_is_valid(self): """Test that an empty formset still calls clean()""" EmptyFsetWontValidateFormset = formset_factory(FavoriteDrinkForm, extra=0, formset=EmptyFsetWontValidate) diff --git a/tests/forms_tests/tests/test_media.py b/tests/forms_tests/tests/test_media.py index 64d29c44cb..4ec5f6ab7e 100644 --- a/tests/forms_tests/tests/test_media.py +++ b/tests/forms_tests/tests/test_media.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from django.forms import CharField, Form, Media, MultiWidget, TextInput from django.template import Context, Template -from django.test import TestCase, override_settings +from django.test import SimpleTestCase, override_settings from django.utils.encoding import force_text @@ -9,7 +9,7 @@ from django.utils.encoding import force_text STATIC_URL=None, MEDIA_URL='http://media.example.com/media/', ) -class FormsMediaTestCase(TestCase): +class FormsMediaTestCase(SimpleTestCase): """Tests for the media handling on widgets and forms""" def test_construction(self): @@ -466,7 +466,7 @@ class FormsMediaTestCase(TestCase): STATIC_URL='http://media.example.com/static/', MEDIA_URL='http://media.example.com/media/', ) -class StaticFormsMediaTestCase(TestCase): +class StaticFormsMediaTestCase(SimpleTestCase): """Tests for the media handling on widgets and forms""" def test_construction(self): diff --git a/tests/forms_tests/tests/test_utils.py b/tests/forms_tests/tests/test_utils.py index 7baf975bea..d13c59ed79 100644 --- a/tests/forms_tests/tests/test_utils.py +++ b/tests/forms_tests/tests/test_utils.py @@ -5,14 +5,14 @@ import copy from django.core.exceptions import ValidationError from django.forms.utils import ErrorDict, ErrorList, flatatt -from django.test import TestCase +from django.test import SimpleTestCase from django.utils import six from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy -class FormsUtilsTestCase(TestCase): +class FormsUtilsTestCase(SimpleTestCase): # Tests for forms/utils.py module. def test_flatatt(self): diff --git a/tests/forms_tests/tests/test_widgets.py b/tests/forms_tests/tests/test_widgets.py index 5f552b03fd..40ff750f60 100644 --- a/tests/forms_tests/tests/test_widgets.py +++ b/tests/forms_tests/tests/test_widgets.py @@ -18,7 +18,7 @@ from django.forms import ( from django.forms.widgets import ( ChoiceFieldRenderer, ChoiceInput, RadioFieldRenderer, ) -from django.test import TestCase, override_settings +from django.test import SimpleTestCase, override_settings from django.utils import six, translation from django.utils.dates import MONTHS_AP from django.utils.encoding import force_text, python_2_unicode_compatible @@ -27,7 +27,7 @@ from django.utils.safestring import SafeData, mark_safe from ..models import Article -class FormsWidgetTests(TestCase): +class FormsWidgetTests(SimpleTestCase): # Each Widget class corresponds to an HTML form widget. A Widget knows how to # render itself, given a field name and some data. Widgets don't perform # validation. @@ -1173,7 +1173,7 @@ class NullBooleanSelectLazyForm(Form): @override_settings(USE_L10N=True) -class FormsI18NWidgetsTests(TestCase): +class FormsI18NWidgetsTests(SimpleTestCase): def setUp(self): super(FormsI18NWidgetsTests, self).setUp() translation.activate('de-at') @@ -1261,7 +1261,7 @@ class SelectAndTextWidget(MultiWidget): choices = property(_get_choices, _set_choices) -class WidgetTests(TestCase): +class WidgetTests(SimpleTestCase): def test_12048(self): # See ticket #12048. w1 = SelectAndTextWidget(choices=[1, 2, 3]) @@ -1303,7 +1303,7 @@ class FakeFieldFile(object): return self.url -class ClearableFileInputTests(TestCase): +class ClearableFileInputTests(SimpleTestCase): def test_clear_input_renders(self): """ A ClearableFileInput with is_required False and rendered with @@ -1436,7 +1436,7 @@ class GetDate(Form): mydate = DateField(widget=SelectDateWidget) -class SelectDateWidgetTests(TestCase): +class SelectDateWidgetTests(SimpleTestCase): # The forms library comes with some extra, higher-level Field and Widget def test_selectdate(self): diff --git a/tests/forms_tests/tests/tests.py b/tests/forms_tests/tests/tests.py index 6dafee1fb8..211866b2f1 100644 --- a/tests/forms_tests/tests/tests.py +++ b/tests/forms_tests/tests/tests.py @@ -9,7 +9,7 @@ from django.forms import ( CharField, FileField, Form, ModelChoiceField, ModelForm, ) from django.forms.models import ModelFormMetaclass -from django.test import TestCase +from django.test import SimpleTestCase, TestCase from django.utils import six from ..models import ( @@ -222,7 +222,7 @@ class FormsModelTestCase(TestCase): self.assertEqual(obj.def_date, datetime.date(1999, 3, 2)) -class RelatedModelFormTests(TestCase): +class RelatedModelFormTests(SimpleTestCase): def test_invalid_loading_order(self): """ Test for issue 10405 |
