Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Remove gettext occurrences from payment and tests.dummy_password_hasher

IKarbowiakb4f964238275
diff --git a/saleor/payment/__init__.py b/saleor/payment/__init__.py
index 3690c89305..2f5a5d90ed 100644
--- a/saleor/payment/__init__.py
+++ b/saleor/payment/__init__.py
@@ -1,7 +1,5 @@
from enum import Enum
-from django.utils.translation import pgettext_lazy
-
class PaymentError(Exception):
def __init__(self, message):
@@ -16,7 +14,7 @@ class GatewayError(IOError):
class CustomPaymentChoices:
MANUAL = "manual"
- CHOICES = [(MANUAL, pgettext_lazy("Custom payment choice type", "Manual"))]
+ CHOICES = [(MANUAL, "Manual")]
class OperationType(Enum):
@@ -64,11 +62,11 @@ class TransactionKind:
# Which were authorized, but needs to be confirmed manually by staff
# eg. Braintree with "submit_for_settlement" enabled
CHOICES = [
- (AUTH, pgettext_lazy("transaction kind", "Authorization")),
- (REFUND, pgettext_lazy("transaction kind", "Refund")),
- (CAPTURE, pgettext_lazy("transaction kind", "Capture")),
- (VOID, pgettext_lazy("transaction kind", "Void")),
- (CONFIRM, pgettext_lazy("transaction kind", "Confirm")),
+ (AUTH, "Authorization"),
+ (REFUND, "Refund"),
+ (CAPTURE, "Capture"),
+ (VOID, "Void"),
+ (CONFIRM, "Confirm"),
]
@@ -92,9 +90,9 @@ class ChargeStatus:
FULLY_REFUNDED = "fully-refunded"
CHOICES = [
- (NOT_CHARGED, pgettext_lazy("payment status", "Not charged")),
- (PARTIALLY_CHARGED, pgettext_lazy("payment status", "Partially charged")),
- (FULLY_CHARGED, pgettext_lazy("payment status", "Fully charged")),
- (PARTIALLY_REFUNDED, pgettext_lazy("payment status", "Partially refunded")),
- (FULLY_REFUNDED, pgettext_lazy("payment status", "Fully refunded")),
+ (NOT_CHARGED, "Not charged"),
+ (PARTIALLY_CHARGED, "Partially charged"),
+ (FULLY_CHARGED, "Fully charged"),
+ (PARTIALLY_REFUNDED, "Partially refunded"),
+ (FULLY_REFUNDED, "Fully refunded"),
]
diff --git a/tests/dummy_password_hasher.py b/tests/dummy_password_hasher.py
index 2d6eaef7fb..761b1dda43 100644
--- a/tests/dummy_password_hasher.py
+++ b/tests/dummy_password_hasher.py
@@ -1,7 +1,6 @@
from collections import OrderedDict
from django.contrib.auth.hashers import BasePasswordHasher
-from django.utils.translation import pgettext_lazy
class DummyHasher(BasePasswordHasher):
@@ -22,12 +21,7 @@ class DummyHasher(BasePasswordHasher):
def safe_summary(self, encoded):
algorithm, dummy_password = encoded.split("$")
- return OrderedDict(
- [
- (pgettext_lazy("algorithm"), algorithm),
- (pgettext_lazy("hash"), dummy_password),
- ]
- )
+ return OrderedDict([algorithm, dummy_password])
def harden_runtime(self, password, encoded):
pass