From 799af89312bb280e3388e53a405cc95ee858fdf9 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 20 May 2022 17:45:04 +0200 Subject: [PATCH] style fixes --- InvenTree/InvenTree/api_tester.py | 5 +++-- InvenTree/InvenTree/test_api.py | 11 +++++------ InvenTree/plugin/base/integration/test_mixins.py | 10 +++++----- setup.cfg | 4 +--- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/InvenTree/InvenTree/api_tester.py b/InvenTree/InvenTree/api_tester.py index c5d96e6bb3..cb5f02cf43 100644 --- a/InvenTree/InvenTree/api_tester.py +++ b/InvenTree/InvenTree/api_tester.py @@ -6,9 +6,10 @@ import csv import io import re -from django.http.response import StreamingHttpResponse from django.contrib.auth import get_user_model from django.contrib.auth.models import Group +from django.http.response import StreamingHttpResponse + from rest_framework.test import APITestCase @@ -60,7 +61,7 @@ class UserMixin: if self.auto_login: self.client.login(username=self.username, password=self.password) - def assignRole(self, role = None, assign_all: bool = False): + def assignRole(self, role=None, assign_all: bool = False): """ Set the user roles for the registered user """ diff --git a/InvenTree/InvenTree/test_api.py b/InvenTree/InvenTree/test_api.py index 10e2305d07..889ff674b3 100644 --- a/InvenTree/InvenTree/test_api.py +++ b/InvenTree/InvenTree/test_api.py @@ -1,16 +1,15 @@ """ Low level tests for the InvenTree API """ +from base64 import b64encode + +from django.urls import reverse + from rest_framework import status -from django.urls import reverse -from InvenTree.helpers import InvenTreeTestCase - from InvenTree.api_tester import InvenTreeAPITestCase - +from InvenTree.helpers import InvenTreeTestCase from users.models import RuleSet -from base64 import b64encode - class HTMLAPITests(InvenTreeTestCase): """ diff --git a/InvenTree/plugin/base/integration/test_mixins.py b/InvenTree/plugin/base/integration/test_mixins.py index 9ccc99528f..20a99e71bd 100644 --- a/InvenTree/plugin/base/integration/test_mixins.py +++ b/InvenTree/plugin/base/integration/test_mixins.py @@ -1,18 +1,18 @@ """ Unit tests for base mixins for plugins """ -from django.test import TestCase from django.conf import settings -from django.urls import include, re_path, reverse from django.contrib.auth import get_user_model +from django.test import TestCase +from django.urls import include, re_path, reverse from error_report.models import Error from plugin import InvenTreePlugin -from plugin.mixins import AppMixin, SettingsMixin, UrlsMixin, NavigationMixin, APICallMixin -from plugin.urls import PLUGIN_BASE from plugin.helpers import MixinNotImplementedError - +from plugin.mixins import (APICallMixin, AppMixin, NavigationMixin, + SettingsMixin, UrlsMixin) from plugin.registry import registry +from plugin.urls import PLUGIN_BASE class BaseMixinDefinition: diff --git a/setup.cfg b/setup.cfg index 7fcf9718fe..3aa96371ec 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ ignore = # - W605 - invalid escape sequence W605, # - E501 - line too long (82 characters) - E501, + E501, # - E722 - do not use bare except E722, # - C901 - function is too complex @@ -28,6 +28,4 @@ source = ./InvenTree src_paths=InvenTree skip_glob =*/migrations/*.py known_django=django -import_heading_firstparty=InvenTree imports -import_heading_thirdparty=Third-Party imports sections=FUTURE, STDLIB, DJANGO, THIRDPARTY, FIRSTPARTY, LOCALFOLDER