Merge pull request #5455 from tsiegleauq/another-travis-fix

Pin isort, repair tests
This commit is contained in:
Finn Stutzenstein 2020-07-08 07:16:27 +02:00 committed by GitHub
commit 9eeb287425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 35 additions and 32 deletions

View File

@ -9,9 +9,12 @@ class AgendaAppConfig(AppConfig):
def ready(self):
# Import all required stuff.
from django.db.models.signals import pre_delete, post_save
from django.db.models.signals import post_save, pre_delete
from ..core.signals import permission_change
from ..utils.access_permissions import required_user
from ..utils.rest_api import router
from . import serializers # noqa
from .projector import register_projector_slides
from .signals import (
get_permission_change_data,
@ -19,8 +22,6 @@ class AgendaAppConfig(AppConfig):
listen_to_related_object_post_save,
)
from .views import ItemViewSet, ListOfSpeakersViewSet
from . import serializers # noqa
from ..utils.access_permissions import required_user
# Define projector elements.
register_projector_slides()

View File

@ -16,9 +16,9 @@ class AssignmentsAppConfig(AppConfig):
from .projector import register_projector_slides
from .signals import get_permission_change_data
from .views import (
AssignmentViewSet,
AssignmentPollViewSet,
AssignmentOptionViewSet,
AssignmentPollViewSet,
AssignmentViewSet,
AssignmentVoteViewSet,
)
@ -82,7 +82,7 @@ async def required_users_assignments(element: Dict[str, Any]) -> Set[int]:
Returns all user ids that are displayed as candidates (including poll
options) in the assignment element.
"""
from openslides.assignments.models import AssignmentPoll, AssignmentOption
from openslides.assignments.models import AssignmentOption, AssignmentPoll
from openslides.utils.cache import element_cache
candidates = set(

View File

@ -15,9 +15,12 @@ class CoreAppConfig(AppConfig):
def ready(self):
# Import all required stuff.
# Let all client websocket message register
from ..utils import websocket_client_messages # noqa
from ..utils.rest_api import router
from . import serializers # noqa
from .config import config
from .projector import register_projector_slides
from . import serializers # noqa
from .signals import (
autoupdate_for_many_to_many_relations,
cleanup_unused_permissions,
@ -29,15 +32,11 @@ class CoreAppConfig(AppConfig):
from .views import (
ConfigViewSet,
CountdownViewSet,
ProjectionDefaultViewSet,
ProjectorMessageViewSet,
ProjectorViewSet,
ProjectionDefaultViewSet,
TagViewSet,
)
from ..utils.rest_api import router
# Let all client websocket message register
from ..utils import websocket_client_messages # noqa
# Collect all config variables before getting the constants.
config.collect_config_variables_from_apps()
@ -92,9 +91,9 @@ class CoreAppConfig(AppConfig):
run_startup_hooks()
def get_startup_hooks(self):
from openslides.utils.constants import set_constants_from_apps
from openslides.utils.cache import element_cache
from openslides.core.models import History
from openslides.utils.cache import element_cache
from openslides.utils.constants import set_constants_from_apps
return {
10: element_cache.ensure_schema_version,

View File

@ -11,10 +11,11 @@ class MediafilesAppConfig(AppConfig):
# Import all required stuff.
from openslides.core.signals import permission_change
from openslides.utils.rest_api import router
from . import serializers # noqa
from .projector import register_projector_slides
from .signals import get_permission_change_data
from .views import MediafileViewSet
from . import serializers # noqa
# Validate, that the media_url is correct formatted:
# Must begin and end with a slash. It has to be at least "/".

View File

@ -12,23 +12,24 @@ class MotionsAppConfig(AppConfig):
# Import all required stuff.
from openslides.core.signals import permission_change
from openslides.utils.rest_api import router
from ..utils.access_permissions import required_user
from . import serializers # noqa
from .projector import register_projector_slides
from .signals import create_builtin_workflows, get_permission_change_data
from . import serializers # noqa
from .views import (
CategoryViewSet,
StatuteParagraphViewSet,
MotionViewSet,
MotionCommentSectionViewSet,
MotionVoteViewSet,
MotionBlockViewSet,
MotionPollViewSet,
MotionOptionViewSet,
MotionChangeRecommendationViewSet,
MotionCommentSectionViewSet,
MotionOptionViewSet,
MotionPollViewSet,
MotionViewSet,
MotionVoteViewSet,
StateViewSet,
StatuteParagraphViewSet,
WorkflowViewSet,
)
from ..utils.access_permissions import required_user
# Define projector elements.
register_projector_slides()

View File

@ -8,11 +8,12 @@ class TopicsAppConfig(AppConfig):
def ready(self):
# Import all required stuff.
from openslides.core.signals import permission_change
from ..utils.rest_api import router
from . import serializers # noqa
from .projector import register_projector_slides
from .signals import get_permission_change_data
from .views import TopicViewSet
from . import serializers # noqa
# Define projector elements.
register_projector_slides()

View File

@ -19,8 +19,8 @@ class UserAccessPermissions(BaseAccessPermissions):
not get the fields they should not get.
"""
from .serializers import (
USERCANSEESERIALIZER_FIELDS,
USERCANSEEEXTRASERIALIZER_FIELDS,
USERCANSEESERIALIZER_FIELDS,
)
def filtered_data(full_data, whitelist, whitelist_operator=None):

View File

@ -12,9 +12,9 @@ class UsersAppConfig(AppConfig):
def ready(self):
# Import all required stuff.
from . import serializers # noqa
from ..core.signals import post_permission_creation, permission_change
from ..core.signals import permission_change, post_permission_creation
from ..utils.rest_api import router
from . import serializers # noqa
from .projector import register_projector_slides
from .signals import create_builtin_groups_and_admin, get_permission_change_data
from .views import GroupViewSet, PersonalNoteViewSet, UserViewSet

View File

@ -20,7 +20,7 @@ from .utils import split_element_id, str_dict_to_bytes
logger = logging.getLogger(__name__)
if use_redis:
from .redis import get_connection, aioredis
from .redis import aioredis, get_connection
class CacheReset(Exception):

View File

@ -1,7 +1,7 @@
black
coverage
flake8
isort
isort<5.0.0
mypy
pytest<5.4.2
pytest-django<3.9.0

View File

@ -64,7 +64,7 @@ def constants(request, reset_cache):
Uses fake constants, if the db is not in use.
"""
from openslides.utils.constants import set_constants, get_constants_from_apps
from openslides.utils.constants import get_constants_from_apps, set_constants
if "django_db" in request.node.keywords or is_django_unittest(request):
# When the db is created, use the original constants

View File

@ -1,7 +1,6 @@
"""
Settings file for OpenSlides' tests.
"""
import os
from openslides.global_settings import * # noqa
@ -82,7 +81,8 @@ ENABLE_ELECTRONIC_VOTING = True
# https://stackoverflow.com/questions/24876343/django-traceback-on-queries
if os.environ.get("DEBUG_SQL_TRACEBACK"):
import traceback
import django.db.backends.utils as bakutils
from django.db.backends import utils as bakutils
cursor_debug_wrapper_orig = bakutils.CursorDebugWrapper