summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-01-28 07:35:27 -0500
committerTim Graham <timograham@gmail.com>2015-02-06 08:16:28 -0500
commit0ed7d155635da9f79d4dd67e4889087d3673c6da (patch)
treecf5c59b563f01774f32e20b3af8cb24a387fdc4d /tests/forms_tests
parent388d986b8a6bb1363dab9f53ea435dff4dfe92cb (diff)
Sorted imports with isort; refs #23860.
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/models.py1
-rw-r--r--tests/forms_tests/tests/test_error_messages.py4
-rw-r--r--tests/forms_tests/tests/test_fields.py24
-rw-r--r--tests/forms_tests/tests/test_forms.py10
-rw-r--r--tests/forms_tests/tests/test_formsets.py6
-rw-r--r--tests/forms_tests/tests/test_input_formats.py5
-rw-r--r--tests/forms_tests/tests/test_media.py4
-rw-r--r--tests/forms_tests/tests/test_regressions.py2
-rw-r--r--tests/forms_tests/tests/test_utils.py6
-rw-r--r--tests/forms_tests/tests/test_widgets.py4
-rw-r--r--tests/forms_tests/tests/tests.py10
-rw-r--r--tests/forms_tests/urls.py1
12 files changed, 39 insertions, 38 deletions
diff --git a/tests/forms_tests/models.py b/tests/forms_tests/models.py
index 82fa005025..936bf8b41f 100644
--- a/tests/forms_tests/models.py
+++ b/tests/forms_tests/models.py
@@ -10,7 +10,6 @@ from django.core.files.storage import FileSystemStorage
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
-
callable_default_counter = itertools.count()
callable_default = lambda: next(callable_default_counter)
diff --git a/tests/forms_tests/tests/test_error_messages.py b/tests/forms_tests/tests/test_error_messages.py
index 5f79d4aa95..c02a44f8ff 100644
--- a/tests/forms_tests/tests/test_error_messages.py
+++ b/tests/forms_tests/tests/test_error_messages.py
@@ -7,11 +7,11 @@ from django.forms import (
DecimalField, EmailField, FileField, FloatField, Form,
GenericIPAddressField, IntegerField, ModelChoiceField,
ModelMultipleChoiceField, MultipleChoiceField, RegexField,
- SplitDateTimeField, TimeField, URLField, utils, ValidationError,
+ SplitDateTimeField, TimeField, URLField, ValidationError, utils,
)
from django.test import TestCase
-from django.utils.safestring import mark_safe
from django.utils.encoding import python_2_unicode_compatible
+from django.utils.safestring import mark_safe
class AssertFormErrorsMixin(object):
diff --git a/tests/forms_tests/tests/test_fields.py b/tests/forms_tests/tests/test_fields.py
index fda451281f..ed060bc064 100644
--- a/tests/forms_tests/tests/test_fields.py
+++ b/tests/forms_tests/tests/test_fields.py
@@ -27,34 +27,32 @@ __init__(). For example, CharField has a max_length option.
from __future__ import unicode_literals
import datetime
+import os
import pickle
import re
-import os
import uuid
from decimal import Decimal
from unittest import skipIf
-try:
- from PIL import Image
-except ImportError:
- Image = None
-
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import (
BooleanField, CharField, ChoiceField, ComboField, DateField, DateTimeField,
DecimalField, DurationField, EmailField, Field, FileField, FilePathField,
- FloatField, Form, forms, GenericIPAddressField, HiddenInput, ImageField,
+ FloatField, Form, GenericIPAddressField, HiddenInput, ImageField,
IntegerField, MultipleChoiceField, NullBooleanField, NumberInput,
PasswordInput, RadioSelect, RegexField, SlugField, SplitDateTimeField,
- TextInput, Textarea, TimeField, TypedChoiceField, TypedMultipleChoiceField,
- URLField, UUIDField, ValidationError, Widget,
+ Textarea, TextInput, TimeField, TypedChoiceField, TypedMultipleChoiceField,
+ URLField, UUIDField, ValidationError, Widget, forms,
)
from django.test import SimpleTestCase, ignore_warnings
-from django.utils import formats
-from django.utils import six
-from django.utils import translation
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.utils import formats, six, translation
from django.utils._os import upath
+from django.utils.deprecation import RemovedInDjango20Warning
+
+try:
+ from PIL import Image
+except ImportError:
+ Image = None
def fix_os_paths(x):
diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py
index df090ef60e..4024f0359e 100644
--- a/tests/forms_tests/tests/test_forms.py
+++ b/tests/forms_tests/tests/test_forms.py
@@ -10,22 +10,22 @@ from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.validators import RegexValidator
from django.forms import (
BooleanField, CharField, CheckboxSelectMultiple, ChoiceField, DateField,
- DateTimeField, EmailField, FileField, FloatField, Form, forms, HiddenInput,
+ DateTimeField, EmailField, FileField, FloatField, Form, HiddenInput,
ImageField, IntegerField, MultipleChoiceField, MultipleHiddenInput,
MultiValueField, NullBooleanField, PasswordInput, RadioSelect, Select,
SplitDateTimeField, SplitHiddenDateTimeWidget, Textarea, TextInput,
- TimeField, ValidationError,
+ TimeField, ValidationError, forms,
)
from django.forms.utils import ErrorList
from django.http import QueryDict
-from django.template import Template, Context
+from django.template import Context, Template
from django.test import TestCase
from django.test.utils import str_prefix
+from django.utils import six
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html import format_html
-from django.utils.safestring import mark_safe, SafeData
-from django.utils import six
+from django.utils.safestring import SafeData, mark_safe
class Person(Form):
diff --git a/tests/forms_tests/tests/test_formsets.py b/tests/forms_tests/tests/test_formsets.py
index 276bf1cb22..7f450247eb 100644
--- a/tests/forms_tests/tests/test_formsets.py
+++ b/tests/forms_tests/tests/test_formsets.py
@@ -3,8 +3,10 @@ from __future__ import unicode_literals
import datetime
-from django.forms import (CharField, DateField, FileField, Form, IntegerField,
- SplitDateTimeField, ValidationError, formsets)
+from django.forms import (
+ CharField, DateField, FileField, Form, IntegerField, SplitDateTimeField,
+ ValidationError, formsets,
+)
from django.forms.formsets import BaseFormSet, formset_factory
from django.forms.utils import ErrorList
from django.test import TestCase
diff --git a/tests/forms_tests/tests/test_input_formats.py b/tests/forms_tests/tests/test_input_formats.py
index 60e153db4c..afb2513a95 100644
--- a/tests/forms_tests/tests/test_input_formats.py
+++ b/tests/forms_tests/tests/test_input_formats.py
@@ -1,9 +1,8 @@
-from datetime import time, date, datetime
+from datetime import date, datetime, time
from django import forms
-from django.test import override_settings
+from django.test import SimpleTestCase, override_settings
from django.utils.translation import activate, deactivate
-from django.test import SimpleTestCase
@override_settings(TIME_INPUT_FORMATS=["%I:%M:%S %p", "%I:%M %p"], USE_L10N=True)
diff --git a/tests/forms_tests/tests/test_media.py b/tests/forms_tests/tests/test_media.py
index c44e443eac..027e410f30 100644
--- a/tests/forms_tests/tests/test_media.py
+++ b/tests/forms_tests/tests/test_media.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from django.forms import Media, TextInput, CharField, Form, MultiWidget
-from django.template import Template, Context
+from django.forms import CharField, Form, Media, MultiWidget, TextInput
+from django.template import Context, Template
from django.test import TestCase, override_settings
diff --git a/tests/forms_tests/tests/test_regressions.py b/tests/forms_tests/tests/test_regressions.py
index b0b360e679..3a20d4d9fb 100644
--- a/tests/forms_tests/tests/test_regressions.py
+++ b/tests/forms_tests/tests/test_regressions.py
@@ -10,7 +10,7 @@ from django.test import TestCase, ignore_warnings
from django.utils import translation
from django.utils.translation import gettext_lazy, ugettext_lazy
-from forms_tests.models import Cheese
+from ..models import Cheese
class FormsRegressionsTestCase(TestCase):
diff --git a/tests/forms_tests/tests/test_utils.py b/tests/forms_tests/tests/test_utils.py
index 9f412b7a27..4519963d96 100644
--- a/tests/forms_tests/tests/test_utils.py
+++ b/tests/forms_tests/tests/test_utils.py
@@ -4,12 +4,12 @@ from __future__ import unicode_literals
import copy
from django.core.exceptions import ValidationError
-from django.forms.utils import flatatt, ErrorDict, ErrorList
+from django.forms.utils import ErrorDict, ErrorList, flatatt
from django.test import TestCase
-from django.utils.safestring import mark_safe
from django.utils import six
-from django.utils.translation import ugettext_lazy
from django.utils.encoding import python_2_unicode_compatible
+from django.utils.safestring import mark_safe
+from django.utils.translation import ugettext_lazy
class FormsUtilsTestCase(TestCase):
diff --git a/tests/forms_tests/tests/test_widgets.py b/tests/forms_tests/tests/test_widgets.py
index b58c4e74e4..fc8ac93721 100644
--- a/tests/forms_tests/tests/test_widgets.py
+++ b/tests/forms_tests/tests/test_widgets.py
@@ -16,11 +16,11 @@ from django.forms import (
SplitDateTimeWidget, Textarea, TextInput, TimeInput, ValidationError,
)
from django.forms.widgets import RadioFieldRenderer
-from django.utils.safestring import mark_safe, SafeData
-from django.utils import six, translation
from django.test import TestCase, 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
+from django.utils.safestring import SafeData, mark_safe
from ..models import Article
diff --git a/tests/forms_tests/tests/tests.py b/tests/forms_tests/tests/tests.py
index 0b3d5765a0..8e8aa82cdd 100644
--- a/tests/forms_tests/tests/tests.py
+++ b/tests/forms_tests/tests/tests.py
@@ -5,13 +5,17 @@ import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import models
-from django.forms import Form, ModelForm, FileField, ModelChoiceField, CharField
+from django.forms import (
+ CharField, FileField, Form, ModelChoiceField, ModelForm,
+)
from django.forms.models import ModelFormMetaclass
from django.test import TestCase
from django.utils import six
-from ..models import (ChoiceModel, ChoiceOptionModel, ChoiceFieldModel,
- FileModel, Group, BoundaryModel, Defaults, OptionalMultiChoiceModel)
+from ..models import (
+ BoundaryModel, ChoiceFieldModel, ChoiceModel, ChoiceOptionModel, Defaults,
+ FileModel, Group, OptionalMultiChoiceModel,
+)
class ChoiceFieldForm(ModelForm):
diff --git a/tests/forms_tests/urls.py b/tests/forms_tests/urls.py
index e4a91469b1..ab7fa902a9 100644
--- a/tests/forms_tests/urls.py
+++ b/tests/forms_tests/urls.py
@@ -2,7 +2,6 @@ from django.conf.urls import url
from .views import ArticleFormView
-
urlpatterns = [
url(r'^model_form/(?P<pk>[0-9]+)/$', ArticleFormView.as_view(), name="article_form"),
]