diff --git a/djstripe/admin/actions.py b/djstripe/admin/actions.py index 84e2a03db0..086b622220 100644 --- a/djstripe/admin/actions.py +++ b/djstripe/admin/actions.py @@ -1,6 +1,7 @@ """ Django Administration Custom Actions Module """ + from django.contrib import admin from django.contrib.admin import helpers from django.contrib.admin.utils import quote diff --git a/djstripe/admin/admin_inline.py b/djstripe/admin/admin_inline.py index 8164696b23..945282e970 100644 --- a/djstripe/admin/admin_inline.py +++ b/djstripe/admin/admin_inline.py @@ -1,6 +1,7 @@ """ Django Administration Inline interface definitions """ + from django.contrib import admin from djstripe import models diff --git a/djstripe/admin/filters.py b/djstripe/admin/filters.py index 69543a5f1e..223062685d 100644 --- a/djstripe/admin/filters.py +++ b/djstripe/admin/filters.py @@ -1,6 +1,7 @@ """ Django Administration Custom Filters Module """ + from django.contrib import admin from djstripe import models diff --git a/djstripe/admin/views.py b/djstripe/admin/views.py index 98b7af4702..c6710501fc 100644 --- a/djstripe/admin/views.py +++ b/djstripe/admin/views.py @@ -1,6 +1,7 @@ """ dj-stripe - Views related to the djstripe app. """ + import logging import stripe diff --git a/djstripe/apps.py b/djstripe/apps.py index 6e1a8fe5fb..80478b17aa 100644 --- a/djstripe/apps.py +++ b/djstripe/apps.py @@ -1,6 +1,7 @@ """ dj-stripe - Django + Stripe Made Easy """ + from importlib.metadata import version from django.apps import AppConfig diff --git a/djstripe/checks.py b/djstripe/checks.py index b9456c5ea1..30260b2ea0 100644 --- a/djstripe/checks.py +++ b/djstripe/checks.py @@ -1,6 +1,7 @@ """ dj-stripe System Checks """ + import re from django.core import checks diff --git a/djstripe/enums.py b/djstripe/enums.py index 6e18245f1f..3a33c66177 100644 --- a/djstripe/enums.py +++ b/djstripe/enums.py @@ -742,7 +742,6 @@ class SourceRedirectStatus(Enum): failed = _("Failed") - class SubscriptionScheduleEndBehavior(Enum): release = _("Release") cancel = _("Cancel") diff --git a/djstripe/fields.py b/djstripe/fields.py index c8fc98b561..f7e7d3bc5a 100644 --- a/djstripe/fields.py +++ b/djstripe/fields.py @@ -1,6 +1,7 @@ """ dj-stripe Custom Field Definitions """ + import decimal from django.core.validators import MaxValueValidator, MinValueValidator diff --git a/djstripe/management/commands/djstripe_init_customers.py b/djstripe/management/commands/djstripe_init_customers.py index d6fccdb87e..5a2a829c80 100644 --- a/djstripe/management/commands/djstripe_init_customers.py +++ b/djstripe/management/commands/djstripe_init_customers.py @@ -1,6 +1,7 @@ """ init_customers command. """ + from django.core.management.base import BaseCommand from ...models import Customer diff --git a/djstripe/management/commands/djstripe_sync_customers.py b/djstripe/management/commands/djstripe_sync_customers.py index 1ba5270c8b..c6775544fa 100644 --- a/djstripe/management/commands/djstripe_sync_customers.py +++ b/djstripe/management/commands/djstripe_sync_customers.py @@ -1,6 +1,7 @@ """ sync_customer command. """ + from django.core.management.base import BaseCommand from ...settings import djstripe_settings diff --git a/djstripe/managers.py b/djstripe/managers.py index 941b6e3af7..e28827e391 100644 --- a/djstripe/managers.py +++ b/djstripe/managers.py @@ -1,6 +1,7 @@ """ dj-stripe model managers """ + import decimal from django.db import models diff --git a/djstripe/mixins.py b/djstripe/mixins.py index b73d3bf4dc..04ad9fcbfb 100644 --- a/djstripe/mixins.py +++ b/djstripe/mixins.py @@ -1,6 +1,7 @@ """ dj-stripe mixins """ + import sys import traceback diff --git a/djstripe/settings.py b/djstripe/settings.py index 48b0ff0de5..57b9ef7cb3 100644 --- a/djstripe/settings.py +++ b/djstripe/settings.py @@ -1,6 +1,7 @@ """ dj-stripe settings """ + import stripe from django.apps import apps as django_apps from django.conf import settings diff --git a/djstripe/signals.py b/djstripe/signals.py index 123d9be8d7..6e07a7323e 100644 --- a/djstripe/signals.py +++ b/djstripe/signals.py @@ -3,6 +3,7 @@ Stripe docs for Webhooks: https://stripe.com/docs/webhooks """ + from django.dispatch import Signal # providing_args=["instance", "api_key"] diff --git a/djstripe/urls.py b/djstripe/urls.py index 73df2070a1..2be4e46e6b 100644 --- a/djstripe/urls.py +++ b/djstripe/urls.py @@ -7,6 +7,7 @@ # url can be changed # Call to 'djstripe.urls' and 'namespace' must stay as is """ + from django.urls import path from . import views diff --git a/djstripe/utils.py b/djstripe/utils.py index 7d55842f7b..20c99d633e 100644 --- a/djstripe/utils.py +++ b/djstripe/utils.py @@ -1,6 +1,7 @@ """ Utility functions related to the djstripe app. """ + import datetime from typing import Optional diff --git a/djstripe/views.py b/djstripe/views.py index 30ee939841..f3b1f4d22d 100644 --- a/djstripe/views.py +++ b/djstripe/views.py @@ -1,6 +1,7 @@ """ dj-stripe - Views related to the djstripe app. """ + import logging from django.http import HttpResponse, HttpResponseBadRequest diff --git a/tests/test_account.py b/tests/test_account.py index 0454f88195..d3e648ec80 100644 --- a/tests/test_account.py +++ b/tests/test_account.py @@ -1,6 +1,7 @@ """ dj-stripe Account Tests. """ + from copy import deepcopy from unittest.mock import call, patch diff --git a/tests/test_admin.py b/tests/test_admin.py index e5600bf502..b67a331a61 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -1,6 +1,7 @@ """ dj-stripe Admin Tests. """ + from copy import deepcopy from typing import Sequence diff --git a/tests/test_apikey.py b/tests/test_apikey.py index c2615f076a..865205b948 100644 --- a/tests/test_apikey.py +++ b/tests/test_apikey.py @@ -1,6 +1,7 @@ """ dj-stripe APIKey model tests """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_balance_transaction.py b/tests/test_balance_transaction.py index 8cddf1aff8..3f53fe0c12 100644 --- a/tests/test_balance_transaction.py +++ b/tests/test_balance_transaction.py @@ -1,6 +1,7 @@ """ dj-stripe BalanceTransaction model tests """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_bank_account.py b/tests/test_bank_account.py index 6ba02ca56c..3094cb171d 100644 --- a/tests/test_bank_account.py +++ b/tests/test_bank_account.py @@ -1,6 +1,7 @@ """ dj-stripe Bank Account Model Tests. """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_charge.py b/tests/test_charge.py index 4e1a8dd15b..8442c20128 100644 --- a/tests/test_charge.py +++ b/tests/test_charge.py @@ -1,6 +1,7 @@ """ dj-stripe Charge Model Tests. """ + from copy import deepcopy from decimal import Decimal from unittest.mock import call, create_autospec, patch diff --git a/tests/test_discount.py b/tests/test_discount.py index 58e2fdcc29..51fde67e50 100644 --- a/tests/test_discount.py +++ b/tests/test_discount.py @@ -1,6 +1,7 @@ """ dj-stripe Discount model tests """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_dispute.py b/tests/test_dispute.py index 9eade57d49..d4bda49d76 100644 --- a/tests/test_dispute.py +++ b/tests/test_dispute.py @@ -1,6 +1,7 @@ """ dj-stripe Dispute model tests """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_fields.py b/tests/test_fields.py index ea516b6000..00cfbe625f 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -1,6 +1,7 @@ """ dj-stripe Custom Field Tests. """ + from datetime import datetime from decimal import Decimal diff --git a/tests/test_file_link.py b/tests/test_file_link.py index 88b16a8ffa..bdb8afd610 100644 --- a/tests/test_file_link.py +++ b/tests/test_file_link.py @@ -1,6 +1,7 @@ """ dj-stripe FileLink model tests """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_file_upload.py b/tests/test_file_upload.py index 376c054e76..d447361af4 100644 --- a/tests/test_file_upload.py +++ b/tests/test_file_upload.py @@ -1,6 +1,7 @@ """ dj-stripe File model tests """ + from copy import deepcopy from unittest.mock import ANY, call, patch diff --git a/tests/test_forms.py b/tests/test_forms.py index aadefec239..944b66a403 100644 --- a/tests/test_forms.py +++ b/tests/test_forms.py @@ -1,6 +1,7 @@ """ dj-stripe form tests """ + import pytest from django import forms from django.contrib.admin import helpers diff --git a/tests/test_invoiceitem.py b/tests/test_invoiceitem.py index 72068afffd..6a8d0d24bd 100644 --- a/tests/test_invoiceitem.py +++ b/tests/test_invoiceitem.py @@ -1,6 +1,7 @@ """ dj-stripe InvoiceItem Model Tests. """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_line_item.py b/tests/test_line_item.py index 7a198aedb8..339dc9bcb3 100644 --- a/tests/test_line_item.py +++ b/tests/test_line_item.py @@ -1,6 +1,7 @@ """ dj-stripe LineItem Model Tests. """ + from copy import deepcopy from unittest.mock import PropertyMock, patch diff --git a/tests/test_managers.py b/tests/test_managers.py index 4c79918b4e..d515cb1ba2 100644 --- a/tests/test_managers.py +++ b/tests/test_managers.py @@ -1,6 +1,7 @@ """ dj-stripe Model Manager Tests. """ + import datetime import decimal from copy import deepcopy diff --git a/tests/test_migrations.py b/tests/test_migrations.py index d9dd462e50..e6a35424f0 100644 --- a/tests/test_migrations.py +++ b/tests/test_migrations.py @@ -1,6 +1,7 @@ """ dj-stripe Migrations Tests """ + import pytest from django.conf import settings from django.contrib.auth import get_user_model diff --git a/tests/test_mixins.py b/tests/test_mixins.py index aa64fc0549..516401ae95 100644 --- a/tests/test_mixins.py +++ b/tests/test_mixins.py @@ -1,6 +1,7 @@ """ dj-stripe Mixin Tests. """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_payment_intent.py b/tests/test_payment_intent.py index 2df2467040..202092af49 100644 --- a/tests/test_payment_intent.py +++ b/tests/test_payment_intent.py @@ -1,6 +1,7 @@ """ dj-stripe PaymentIntent Model Tests. """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_payout.py b/tests/test_payout.py index 20572658cb..098f534188 100644 --- a/tests/test_payout.py +++ b/tests/test_payout.py @@ -1,6 +1,7 @@ """ dj-stripe Payout Model Tests. """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_plan.py b/tests/test_plan.py index 8a862bb0a6..98d711f5f4 100644 --- a/tests/test_plan.py +++ b/tests/test_plan.py @@ -1,6 +1,7 @@ """ dj-stripe Plan Model Tests. """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_price.py b/tests/test_price.py index a3e20c5a85..61337a1039 100644 --- a/tests/test_price.py +++ b/tests/test_price.py @@ -1,6 +1,7 @@ """ dj-stripe Price model tests """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_refund.py b/tests/test_refund.py index 64cb0ac401..258544afdb 100644 --- a/tests/test_refund.py +++ b/tests/test_refund.py @@ -1,6 +1,7 @@ """ dj-stripe Charge Model Tests. """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_session.py b/tests/test_session.py index e5f9fe9439..ced2924aaf 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -1,6 +1,7 @@ """ dj-stripe Session Model Tests. """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_settings.py b/tests/test_settings.py index 24fa3e035c..6af132f741 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -1,6 +1,7 @@ """ dj-stripe Settings Tests. """ + from unittest.mock import patch import stripe diff --git a/tests/test_setup_intent.py b/tests/test_setup_intent.py index 0c39f76b19..3708da70cc 100644 --- a/tests/test_setup_intent.py +++ b/tests/test_setup_intent.py @@ -1,6 +1,7 @@ """ dj-stripe SetupIntent Model Tests. """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_shipping_rate.py b/tests/test_shipping_rate.py index faf4e0076f..c9b6f13b8d 100644 --- a/tests/test_shipping_rate.py +++ b/tests/test_shipping_rate.py @@ -1,6 +1,7 @@ """ dj-stripe ShippingRate Model Tests. """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_source.py b/tests/test_source.py index ccda46fd90..f8fa57e24f 100644 --- a/tests/test_source.py +++ b/tests/test_source.py @@ -1,6 +1,7 @@ """ dj-stripe Source Model Tests. """ + import sys from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_sourcetransaction.py b/tests/test_sourcetransaction.py index 65b87f49fe..c607434952 100644 --- a/tests/test_sourcetransaction.py +++ b/tests/test_sourcetransaction.py @@ -1,6 +1,7 @@ """ dj-stripe SourceTransaction Model Tests. """ + from copy import deepcopy from unittest.mock import PropertyMock, patch diff --git a/tests/test_stripe_model.py b/tests/test_stripe_model.py index a1d9a0fc41..7d667c5be6 100644 --- a/tests/test_stripe_model.py +++ b/tests/test_stripe_model.py @@ -1,6 +1,7 @@ """ dj-stripe StripeModel Model Tests. """ + from unittest.mock import MagicMock, patch import pytest diff --git a/tests/test_subscription_item.py b/tests/test_subscription_item.py index 414daa8fc5..ac5213f0b4 100644 --- a/tests/test_subscription_item.py +++ b/tests/test_subscription_item.py @@ -1,6 +1,7 @@ """ dj-stripe SubscriptionItem model tests """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_subscription_schedule.py b/tests/test_subscription_schedule.py index 06469c0b31..85618029a9 100644 --- a/tests/test_subscription_schedule.py +++ b/tests/test_subscription_schedule.py @@ -1,6 +1,7 @@ """ dj-stripe SubscriptionSchedule model tests. """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_tax_code.py b/tests/test_tax_code.py index e8036f7756..309c3fa69f 100644 --- a/tests/test_tax_code.py +++ b/tests/test_tax_code.py @@ -1,6 +1,7 @@ """ dj-stripe TaxCode Model Tests. """ + from copy import deepcopy import pytest diff --git a/tests/test_tax_id.py b/tests/test_tax_id.py index dbe6a4d4f1..5825dbe1fe 100644 --- a/tests/test_tax_id.py +++ b/tests/test_tax_id.py @@ -1,6 +1,7 @@ """ dj-stripe TaxId model tests """ + from copy import deepcopy from unittest.mock import PropertyMock, patch diff --git a/tests/test_tax_rates.py b/tests/test_tax_rates.py index 120e473083..32b02c867d 100644 --- a/tests/test_tax_rates.py +++ b/tests/test_tax_rates.py @@ -1,6 +1,7 @@ """ dj-stripe TaxRate Model Tests. """ + from copy import deepcopy from decimal import Decimal diff --git a/tests/test_transfer.py b/tests/test_transfer.py index e938c5adf5..28507e09dc 100644 --- a/tests/test_transfer.py +++ b/tests/test_transfer.py @@ -1,6 +1,7 @@ """ dj-stripe Transfer model tests """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_transfer_reversal.py b/tests/test_transfer_reversal.py index 8a9e504110..0224502d14 100644 --- a/tests/test_transfer_reversal.py +++ b/tests/test_transfer_reversal.py @@ -1,6 +1,7 @@ """ dj-stripe TransferReversal model tests """ + from copy import deepcopy from unittest.mock import PropertyMock, patch diff --git a/tests/test_usage_record.py b/tests/test_usage_record.py index 056ac9548b..1123e81166 100644 --- a/tests/test_usage_record.py +++ b/tests/test_usage_record.py @@ -1,6 +1,7 @@ """ dj-stripe UsageRecord model tests """ + from copy import deepcopy from unittest.mock import patch diff --git a/tests/test_usage_record_summary.py b/tests/test_usage_record_summary.py index ae49dee302..9585440173 100644 --- a/tests/test_usage_record_summary.py +++ b/tests/test_usage_record_summary.py @@ -1,6 +1,7 @@ """ dj-stripe UsageRecordSummary model tests """ + from copy import deepcopy from unittest.mock import PropertyMock, call, patch diff --git a/tests/test_utils.py b/tests/test_utils.py index 2e31c7850a..58de428bf4 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,6 +1,7 @@ """ dj-stripe Utilities Tests. """ + import time from datetime import datetime from decimal import Decimal diff --git a/tests/test_views.py b/tests/test_views.py index 71dd505d1d..426dcccf26 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -1,6 +1,7 @@ """ dj-stripe Views Tests. """ + from copy import deepcopy import pytest diff --git a/tests/test_webhooks.py b/tests/test_webhooks.py index d4497573d1..78c2ea18b9 100644 --- a/tests/test_webhooks.py +++ b/tests/test_webhooks.py @@ -1,6 +1,7 @@ """ dj-stripe Webhook Tests. """ + import json import warnings from copy import deepcopy