mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-13 10:35:40 +00:00
style fixes
This commit is contained in:
@ -6,9 +6,10 @@ import csv
|
|||||||
import io
|
import io
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from django.http.response import StreamingHttpResponse
|
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
from django.contrib.auth.models import Group
|
from django.contrib.auth.models import Group
|
||||||
|
from django.http.response import StreamingHttpResponse
|
||||||
|
|
||||||
from rest_framework.test import APITestCase
|
from rest_framework.test import APITestCase
|
||||||
|
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ class UserMixin:
|
|||||||
if self.auto_login:
|
if self.auto_login:
|
||||||
self.client.login(username=self.username, password=self.password)
|
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
|
Set the user roles for the registered user
|
||||||
"""
|
"""
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
""" Low level tests for the InvenTree API """
|
""" Low level tests for the InvenTree API """
|
||||||
|
|
||||||
|
from base64 import b64encode
|
||||||
|
|
||||||
|
from django.urls import reverse
|
||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from django.urls import reverse
|
|
||||||
from InvenTree.helpers import InvenTreeTestCase
|
|
||||||
|
|
||||||
from InvenTree.api_tester import InvenTreeAPITestCase
|
from InvenTree.api_tester import InvenTreeAPITestCase
|
||||||
|
from InvenTree.helpers import InvenTreeTestCase
|
||||||
from users.models import RuleSet
|
from users.models import RuleSet
|
||||||
|
|
||||||
from base64 import b64encode
|
|
||||||
|
|
||||||
|
|
||||||
class HTMLAPITests(InvenTreeTestCase):
|
class HTMLAPITests(InvenTreeTestCase):
|
||||||
"""
|
"""
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
""" Unit tests for base mixins for plugins """
|
""" Unit tests for base mixins for plugins """
|
||||||
|
|
||||||
from django.test import TestCase
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.urls import include, re_path, reverse
|
|
||||||
from django.contrib.auth import get_user_model
|
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 error_report.models import Error
|
||||||
|
|
||||||
from plugin import InvenTreePlugin
|
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.helpers import MixinNotImplementedError
|
||||||
|
from plugin.mixins import (APICallMixin, AppMixin, NavigationMixin,
|
||||||
|
SettingsMixin, UrlsMixin)
|
||||||
from plugin.registry import registry
|
from plugin.registry import registry
|
||||||
|
from plugin.urls import PLUGIN_BASE
|
||||||
|
|
||||||
|
|
||||||
class BaseMixinDefinition:
|
class BaseMixinDefinition:
|
||||||
|
@ -3,7 +3,7 @@ ignore =
|
|||||||
# - W605 - invalid escape sequence
|
# - W605 - invalid escape sequence
|
||||||
W605,
|
W605,
|
||||||
# - E501 - line too long (82 characters)
|
# - E501 - line too long (82 characters)
|
||||||
E501,
|
E501,
|
||||||
# - E722 - do not use bare except
|
# - E722 - do not use bare except
|
||||||
E722,
|
E722,
|
||||||
# - C901 - function is too complex
|
# - C901 - function is too complex
|
||||||
@ -28,6 +28,4 @@ source = ./InvenTree
|
|||||||
src_paths=InvenTree
|
src_paths=InvenTree
|
||||||
skip_glob =*/migrations/*.py
|
skip_glob =*/migrations/*.py
|
||||||
known_django=django
|
known_django=django
|
||||||
import_heading_firstparty=InvenTree imports
|
|
||||||
import_heading_thirdparty=Third-Party imports
|
|
||||||
sections=FUTURE, STDLIB, DJANGO, THIRDPARTY, FIRSTPARTY, LOCALFOLDER
|
sections=FUTURE, STDLIB, DJANGO, THIRDPARTY, FIRSTPARTY, LOCALFOLDER
|
||||||
|
Reference in New Issue
Block a user