diff --git a/docs/conf.py b/docs/conf.py index 372ff5e94..914126684 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,6 +11,8 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # +from __future__ import annotations + import os import sys from pathlib import Path diff --git a/payments/__init__.py b/payments/__init__.py index 3ca8e04d9..89c7fdb48 100644 --- a/payments/__init__.py +++ b/payments/__init__.py @@ -89,8 +89,8 @@ def get_payment_model(): payment_model = apps.get_model(app_label, model_name) if payment_model is None: msg = ( - 'PAYMENT_MODEL refers to model "%s" that has not been installed' - % settings.PAYMENT_MODEL + f'PAYMENT_MODEL refers to model "{settings.PAYMENT_MODEL}"' + " that has not been installed" ) raise ImproperlyConfigured(msg) return payment_model diff --git a/payments/coinbase/test_coinbase.py b/payments/coinbase/test_coinbase.py index 200c191ec..387fc60da 100644 --- a/payments/coinbase/test_coinbase.py +++ b/payments/coinbase/test_coinbase.py @@ -95,7 +95,7 @@ def test_incorrect_data_process_data(self): def test_provider_returns_checkout_url(self, mocked_post, mocked_time): code = "123abc" signature = "21d476eff7b2e6cccdfe6deb0c097ba638d5de7e775b303e4fdb2f8bfeff72e2" - url = "https://sandbox.coinbase.com/checkouts/%s" % code + url = f"https://sandbox.coinbase.com/checkouts/{code}" post = MagicMock() post.json = MagicMock(return_value={"button": {"code": code}}) post.status_code = 200 diff --git a/payments/sofort/__init__.py b/payments/sofort/__init__.py index 1d1d65101..8c9b42478 100644 --- a/payments/sofort/__init__.py +++ b/payments/sofort/__init__.py @@ -122,7 +122,7 @@ def refund(self, payment, amount=None): "holder": sender_data["holder"], "bic": sender_data["bic"], "iban": sender_data["iban"], - "title": "Refund %s" % payment.description, + "title": f"Refund {payment.description}", "transaction_id": payment.transaction_id, "amount": amount, "comment": "User requested a refund", diff --git a/testapp/manage.py b/testapp/manage.py index 4c28ac632..6f0326023 100755 --- a/testapp/manage.py +++ b/testapp/manage.py @@ -1,5 +1,6 @@ #!/usr/bin/env python """Django's command-line utility for administrative tasks.""" + from __future__ import annotations import os