Skip to content

Commit

Permalink
Isort tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jarekwg committed Jul 6, 2016
1 parent 561ff00 commit 56a1f53
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 26 deletions.
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ universal=1

[isort]
known_django = django
sections = FUTURE,STDLIB,THIRDPARTY,DJANGO,FIRSTPARTY,LOCALFOLDER
sections = FUTURE,STDLIB,THIRDPARTY,DJANGO,FIRSTPARTY,TESTS,LOCALFOLDER
default_section = THIRDPARTY
known_standard_library = requests
known_first_party = django_hstore
known_tests = django_hstore_tests
multi_line_output = 3
line_length = 100
indent = 4
33 changes: 17 additions & 16 deletions tests/django_hstore_tests/tests/test_dictionary_field.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
# -*- coding: utf-8 -*-
import sys
import datetime
import json
import pickle
import sys
from decimal import Decimal
import datetime

from django import VERSION as DJANGO_VERSION
from django import forms
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import transaction
from django.db.models.aggregates import Count
from django.db.utils import IntegrityError
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.utils.encoding import force_text
from django.test import TestCase
from django.utils.encoding import force_text

from django_hstore import get_version
from django_hstore.forms import DictionaryFieldWidget
from django_hstore.fields import HStoreDict
from django_hstore.exceptions import HStoreDictException
from django_hstore.fields import HStoreDict
from django_hstore.forms import DictionaryFieldWidget
from django_hstore.utils import get_cast_for_param

from django_hstore_tests.models import (DataBag,
DefaultsModel,
NullableDataBag,
BadDefaultsModel,
UniqueTogetherDataBag,
NumberedDataBag)
from django_hstore_tests.models import (
BadDefaultsModel,
DataBag,
DefaultsModel,
NullableDataBag,
NumberedDataBag,
UniqueTogetherDataBag
)


class TestDictionaryField(TestCase):
Expand Down Expand Up @@ -64,7 +66,7 @@ def test_decimal(self):

def test_long(self):
if sys.version < '3':
l = long(100000000000)
l = long(100000000000) # noqa
databag = DataBag(name='long')
databag.data['long'] = l
self.assertEqual(databag.data['long'], force_text(l))
Expand Down Expand Up @@ -172,7 +174,6 @@ def test_named_querying(self):

def test_aggregates(self):
self._create_bitfield_bags()

self.assertEqual(DataBag.objects.filter(data__contains={'b0': '1'}).aggregate(Count('id'))['id__count'], 5)
self.assertEqual(DataBag.objects.filter(data__contains={'b1': '1'}).aggregate(Count('id'))['id__count'], 4)

Expand Down
2 changes: 1 addition & 1 deletion tests/django_hstore_tests/tests/test_not_transactional.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django import VERSION as DJANGO_VERSION
from django.db import transaction, connection
from django.db import connection, transaction
from django.test import SimpleTestCase

from django_hstore.fields import HStoreDict
Expand Down
8 changes: 4 additions & 4 deletions tests/django_hstore_tests/tests/test_reference_field.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from django.core.urlresolvers import reverse
from django import forms
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from django import forms

from django_hstore.forms import ReferencesFieldWidget
from django_hstore.utils import unserialize_references, serialize_references, acquire_reference
from django_hstore.utils import acquire_reference, serialize_references, unserialize_references

from django_hstore_tests.models import Ref, RefsBag, NullableRefsBag
from django_hstore_tests.models import NullableRefsBag, Ref, RefsBag


class TestReferencesField(TestCase):
Expand Down
4 changes: 2 additions & 2 deletions tests/django_hstore_tests/tests/test_schema_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import shutil
import sys

from django_hstore_tests.models import NullSchemaDataBag, SchemaDataBag

import django
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
Expand All @@ -16,6 +14,8 @@
from django_hstore import hstore
from django_hstore.virtual import create_hstore_virtual_field

from django_hstore_tests.models import NullSchemaDataBag, SchemaDataBag

if sys.version_info[0] >= 3:
from io import StringIO
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import datetime

from django import forms
from django.db.models.aggregates import Count
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.db.models.aggregates import Count
from django.test import TestCase

from django_hstore.forms import SerializedDictionaryFieldWidget
Expand Down

0 comments on commit 56a1f53

Please sign in to comment.