Skip to content

Commit

Permalink
Fix issues reported by tox
Browse files Browse the repository at this point in the history
  • Loading branch information
subhashb committed Mar 8, 2019
1 parent 921f7c8 commit ae0b77d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/protean/core/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def order_by(self, order_by: Union[set, str]):

def _retrieve_model(self):
"""Retrieve model details associated with this Entity"""
# FIXME Move to a better placement
# FIXME Move to a better placement

# Fetch Model class and connected-adapter from Repository Factory
model_cls = repo_factory.get_model(self._entity_cls_name)
Expand Down
3 changes: 2 additions & 1 deletion src/protean/core/repository/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

from protean.core.exceptions import ConfigurationError
from protean.utils import inflection
from protean.utils.query import RegisterLookupMixin, Q
from protean.utils.query import Q
from protean.utils.query import RegisterLookupMixin

from .factory import repo_factory
from .pagination import Pagination
Expand Down
1 change: 0 additions & 1 deletion src/protean/core/repository/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from protean.conf import active_config
from protean.core.exceptions import ConfigurationError


logger = logging.getLogger('protean.repository')


Expand Down
13 changes: 0 additions & 13 deletions tests/core/test_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,11 @@

from collections import OrderedDict

import mock
import pytest
from tests.support.dog import Dog
from tests.support.dog import DogRelatedByEmail
from tests.support.dog import HasManyDog1
from tests.support.dog import HasManyDog2
from tests.support.dog import HasManyDog3
from tests.support.dog import HasOneDog1
from tests.support.dog import HasOneDog2
from tests.support.dog import HasOneDog3
from tests.support.dog import RelatedDog
from tests.support.dog import RelatedDog2
from tests.support.human import HasManyHuman1
from tests.support.human import HasManyHuman2
from tests.support.human import HasManyHuman3
from tests.support.human import HasOneHuman1
from tests.support.human import HasOneHuman2
from tests.support.human import HasOneHuman3
from tests.support.human import Human

from protean.core import field
Expand Down
5 changes: 2 additions & 3 deletions tests/core/test_entity_associations.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
""" Test cases for Entity Reference field and association types """
import mock
import pytest

from protean.core.exceptions import ValidationError

from tests.support.dog import Dog
from tests.support.dog import DogRelatedByEmail
from tests.support.dog import HasManyDog1
Expand All @@ -22,6 +19,8 @@
from tests.support.human import HasOneHuman3
from tests.support.human import Human

from protean.core.exceptions import ValidationError


class TestReference:
"""Class to test References (Foreign Key) Association"""
Expand Down
1 change: 1 addition & 0 deletions tests/core/test_entity_state.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" Tests for the entity state class"""
from tests.support.dog import Dog

from protean.core.exceptions import ValidationError


Expand Down
5 changes: 3 additions & 2 deletions tests/core/test_q_object.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
""" Test the Q object used for managing filter criteria """
from protean.utils.query import Q
from protean.core.entity import QuerySet
from tests.support.dog import Dog

from protean.core.entity import QuerySet
from protean.utils.query import Q


class TestCriteriaConstruction:
"""Test Conjunction operations on QuerySet"""
Expand Down
1 change: 0 additions & 1 deletion tests/core/test_queryset.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,3 @@ def test_first_with_cache(self):
Dog.create(id=5, name='Berry', age=8, owner='John')
assert query.first.id == 2
assert query.all().first.id == 5

0 comments on commit ae0b77d

Please sign in to comment.