style fixes

This commit is contained in:
Matthias Mair 2022-05-20 17:45:04 +02:00
parent a148dbf303
commit 799af89312
4 changed files with 14 additions and 16 deletions

View File

@ -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
"""

View File

@ -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):
"""

View File

@ -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:

View File

@ -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