summaryrefslogtreecommitdiff
path: root/tests/model_fields
diff options
context:
space:
mode:
Diffstat (limited to 'tests/model_fields')
-rw-r--r--tests/model_fields/models.py22
-rw-r--r--tests/model_fields/test_field_flags.py6
-rw-r--r--tests/model_fields/test_uuid.py2
-rw-r--r--tests/model_fields/tests.py28
4 files changed, 29 insertions, 29 deletions
diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py
index 9a6a3f1f36..ee2f807146 100644
--- a/tests/model_fields/models.py
+++ b/tests/model_fields/models.py
@@ -2,21 +2,23 @@ import os
import tempfile
import uuid
-try:
- from PIL import Image
-except ImportError:
- Image = None
-
-from django.core.files.storage import FileSystemStorage
-from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
+from django.contrib.contenttypes.fields import (
+ GenericForeignKey, GenericRelation,
+)
from django.contrib.contenttypes.models import ContentType
+from django.core.files.storage import FileSystemStorage
+from django.db import models
+from django.db.models.fields.files import ImageField, ImageFieldFile
from django.db.models.fields.related import (
- ForeignObject, ForeignKey, ManyToManyField, OneToOneField,
+ ForeignKey, ForeignObject, ManyToManyField, OneToOneField,
)
-from django.db import models
-from django.db.models.fields.files import ImageFieldFile, ImageField
from django.utils import six
+try:
+ from PIL import Image
+except ImportError:
+ Image = None
+
class Foo(models.Model):
a = models.CharField(max_length=10)
diff --git a/tests/model_fields/test_field_flags.py b/tests/model_fields/test_field_flags.py
index 08a57db501..3749e55452 100644
--- a/tests/model_fields/test_field_flags.py
+++ b/tests/model_fields/test_field_flags.py
@@ -1,17 +1,15 @@
from django import test
-
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.db import models
from django.db.models.fields.related import (
- ForeignObject, ForeignKey, OneToOneField, ManyToManyField,
- ManyToOneRel, ForeignObjectRel,
+ ForeignKey, ForeignObject, ForeignObjectRel, ManyToManyField, ManyToOneRel,
+ OneToOneField,
)
from .models import AllFieldsModel
-
NON_CONCRETE_FIELDS = (
ForeignObject,
GenericForeignKey,
diff --git a/tests/model_fields/test_uuid.py b/tests/model_fields/test_uuid.py
index d2ffe71a3a..4680d5dbb4 100644
--- a/tests/model_fields/test_uuid.py
+++ b/tests/model_fields/test_uuid.py
@@ -5,7 +5,7 @@ from django.core import exceptions, serializers
from django.db import models
from django.test import TestCase
-from .models import UUIDModel, NullableUUIDModel, PrimaryKeyUUIDModel
+from .models import NullableUUIDModel, PrimaryKeyUUIDModel, UUIDModel
class TestSaveLoad(TestCase):
diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py
index 5c8c8109d1..8894ef9158 100644
--- a/tests/model_fields/tests.py
+++ b/tests/model_fields/tests.py
@@ -1,22 +1,21 @@
from __future__ import unicode_literals
import datetime
-from decimal import Decimal
import unittest
+from decimal import Decimal
-from django import test
-from django import forms
-from django.core import validators
-from django.core import checks
+from django import forms, test
+from django.core import checks, validators
from django.core.exceptions import ValidationError
-from django.db import connection, transaction, models, IntegrityError
+from django.db import IntegrityError, connection, models, transaction
from django.db.models.fields import (
- AutoField, BigIntegerField, BinaryField, BooleanField, CharField,
- CommaSeparatedIntegerField, DateField, DateTimeField, DecimalField,
- EmailField, FilePathField, FloatField, IntegerField, IPAddressField,
- GenericIPAddressField, NOT_PROVIDED, NullBooleanField, PositiveIntegerField,
+ NOT_PROVIDED, AutoField, BigIntegerField, BinaryField, BooleanField,
+ CharField, CommaSeparatedIntegerField, DateField, DateTimeField,
+ DecimalField, EmailField, FilePathField, FloatField, GenericIPAddressField,
+ IntegerField, IPAddressField, NullBooleanField, PositiveIntegerField,
PositiveSmallIntegerField, SlugField, SmallIntegerField, TextField,
- TimeField, URLField)
+ TimeField, URLField,
+)
from django.db.models.fields.files import FileField, ImageField
from django.utils import six
from django.utils.functional import lazy
@@ -24,9 +23,10 @@ from django.utils.functional import lazy
from .models import (
Bar, BigD, BigIntegerModel, BigS, BooleanModel, DataModel, DateTimeModel,
Document, FksToBooleans, FkToChar, FloatModel, Foo, GenericIPAddress,
- IntegerModel, NullBooleanModel, PositiveIntegerModel, PositiveSmallIntegerModel,
- Post, PrimaryKeyCharModel, RenamedField, SmallIntegerModel, VerboseNameField,
- Whiz, WhizIter, WhizIterEmpty)
+ IntegerModel, NullBooleanModel, PositiveIntegerModel,
+ PositiveSmallIntegerModel, Post, PrimaryKeyCharModel, RenamedField,
+ SmallIntegerModel, VerboseNameField, Whiz, WhizIter, WhizIterEmpty,
+)
class BasicFieldTests(test.TestCase):