diff --git a/django_dump_die/constants.py b/django_dump_die/constants.py index d8b64b22dfdd819adef2c7220eda8c703673625c..1ad6646e12dfdc54cd8f5456cf1da652c2e1bfbe 100644 --- a/django_dump_die/constants.py +++ b/django_dump_die/constants.py @@ -1,15 +1,16 @@ """Constants for dump die""" +# System Imports. import datetime import types - from decimal import Decimal +from pathlib import PosixPath, PurePath, PurePosixPath, PureWindowsPath + +# Third-Party Imports. from django.conf import settings from django.forms.boundfield import BoundField from django.utils import timezone -from pathlib import PosixPath, PurePath, PurePosixPath, PureWindowsPath - # Imports that may not be accessible, depending on local python environment setup. try: import pytz diff --git a/django_dump_die/middleware.py b/django_dump_die/middleware.py index 2b1d7b0ffd0a2b0b5053198a1dc75ef3b3fb4b79..5ae04aee386174e49c11b5ae3aa4d662ec145b96 100644 --- a/django_dump_die/middleware.py +++ b/django_dump_die/middleware.py @@ -2,10 +2,13 @@ Middleware for DumpAndDie. """ +# System Imports. import logging +# Third-Party Imports. from django.conf import settings +# Internal Imports. from .views import dd_view from django_dump_die.utils import get_dumped_object_info diff --git a/django_dump_die/templatetags/dump_die.py b/django_dump_die/templatetags/dump_die.py index 00480412f0a4d9056e6bae52c5177e0959652afe..b4d4ad7d11720b3874a437b7ed183b15788b0f55 100644 --- a/django_dump_die/templatetags/dump_die.py +++ b/django_dump_die/templatetags/dump_die.py @@ -1,14 +1,16 @@ """Template Tags for DumpDie""" +# System Imports. import inspect import re import types - from decimal import Decimal +# Third-Party Imports. from django import template from django.forms.boundfield import BoundField +# Internal Imports. from django_dump_die.constants import ( SIMPLE_TYPES, INTERMEDIATE_TYPES, @@ -26,7 +28,6 @@ from django_dump_die.constants import ( INCLUDE_FUNCTIONS, PYTZ_PRESENT, ) - from django_dump_die.utils import ( get_dumped_object_info, generate_unique_from_obj, diff --git a/django_dump_die/utils.py b/django_dump_die/utils.py index 1ae450bc0ae625ecaeb93c61bbe1ce20198d2f63..d033b941d6e6e55908d26aa291eb76d45d2aa078 100644 --- a/django_dump_die/utils.py +++ b/django_dump_die/utils.py @@ -1,12 +1,15 @@ """Utils for dump die""" +# System Imports. import copy import inspect -import linecache -import tokenize - import io +import linecache import re +import tokenize +from collections.abc import Sequence +from decimal import Decimal +from enum import EnumMeta from tokenize import ( generate_tokens, ENDMARKER, @@ -17,13 +20,11 @@ from tokenize import ( STRING, ) -from collections.abc import Sequence -from decimal import Decimal -from enum import EnumMeta - +# Third-Party Imports. from django.core.exceptions import ObjectDoesNotExist from django.http import QueryDict +# Internal Imports. from django_dump_die.constants import COLORIZE_DUMPED_OBJECT_NAME, INCLUDE_FILENAME_LINENUMBER, PYTZ_PRESENT # Imports that may not be accessible, depending on local python environment setup. diff --git a/django_dump_die/views/dd_view.py b/django_dump_die/views/dd_view.py index 2ad4ad73c4c6ea690120721f2b352b3429ce71af..872a506789ce94a7172a1dce1fd05aa7c28d3fb5 100644 --- a/django_dump_die/views/dd_view.py +++ b/django_dump_die/views/dd_view.py @@ -1,6 +1,6 @@ """Core view for DumpDie library. All logic renders from this.""" - +# Third-Party Imports. from django.conf import settings from django.shortcuts import render diff --git a/django_dump_die/views/example_helpers.py b/django_dump_die/views/example_helpers.py index 693f470b6e525650bbde92e7303ef83a48baafad..777c68b5c86daca3268d49bca5bbdffcbc444d4e 100644 --- a/django_dump_die/views/example_helpers.py +++ b/django_dump_die/views/example_helpers.py @@ -26,6 +26,7 @@ from django.utils import timezone # Internal Imports. from django_dump_die.constants import PYTZ_PRESENT, ZONEINFO_PRESENT +# Imports that may not be accessible, depending on local python environment setup. if PYTZ_PRESENT: import pytz if ZONEINFO_PRESENT: diff --git a/tests/settings.py b/tests/settings.py index 1bbb6d8d2d4ad245f05b3be8ab3c7f9b807d8eba..4718f522b87b2ac14284dc2f6fead74c75cd2dc1 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -1,4 +1,8 @@ +""" +Project testing settings, so that tests can run project as if it was a proper Django application. +""" +# System Imports. import sys diff --git a/tests/test_views/test_complex_type.py b/tests/test_views/test_complex_type.py index 3312b2c0b1ee931862e742121a7e73b01036884a..8c96b783d63308a3a6b56872174493a9a56635e0 100644 --- a/tests/test_views/test_complex_type.py +++ b/tests/test_views/test_complex_type.py @@ -2,10 +2,11 @@ Tests for "complex" type DD output. """ +# System Imports. +from unittest.mock import patch # Third-Party Imports. from django.test import override_settings -from unittest.mock import patch from django_expanded_test_cases import IntegrationTestCase diff --git a/tests/test_views/test_simple_type.py b/tests/test_views/test_simple_type.py index ef42a56d765be5305a486a3c568c25ae9d5ed419..cdc5798ae32748dc3d5302179608e33e75783145 100644 --- a/tests/test_views/test_simple_type.py +++ b/tests/test_views/test_simple_type.py @@ -4,8 +4,6 @@ Tests for "simple" type DD output. # Third-Party Imports. from django.test import override_settings - -# Internal Imports. from django_expanded_test_cases import IntegrationTestCase diff --git a/tests/views.py b/tests/views.py index 170a56e25fa49b9f10c9553c422800f10f5f4980..84a7ed0f97c27d99515b86b8002afb2f6dcad3d4 100644 --- a/tests/views.py +++ b/tests/views.py @@ -1,8 +1,12 @@ """Views for testing DumpDie""" + +# System Imports. from decimal import Decimal -from django.http import HttpResponse from types import ModuleType +# Third-Party Imports. +from django.http import HttpResponse + def function_example(request): """Function Type Example Test View."""