Skip to content

Commit 82e9149

Browse files
authored
chore: remove unused property (#18359)
1 parent 15972b9 commit 82e9149

File tree

3 files changed

+0
-45
lines changed

3 files changed

+0
-45
lines changed

tests/unit/accounts/test_services.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,40 +1477,6 @@ def test_failure_message(self, help_url, expected):
14771477
)
14781478
assert svc.failure_message == expected
14791479

1480-
@pytest.mark.parametrize(
1481-
("help_url", "expected"),
1482-
[
1483-
(
1484-
None,
1485-
(
1486-
"This password appears in a security breach or has been "
1487-
"compromised and cannot be used."
1488-
),
1489-
),
1490-
(
1491-
"http://localhost/help/#compromised-password",
1492-
(
1493-
"This password appears in a security breach or has been "
1494-
"compromised and cannot be used. See the FAQ entry at "
1495-
"http://localhost/help/#compromised-password for more information."
1496-
),
1497-
),
1498-
],
1499-
)
1500-
def test_failure_message_plain(self, help_url, expected):
1501-
context = pretend.stub()
1502-
request = pretend.stub(
1503-
http=pretend.stub(),
1504-
find_service=lambda iface, context: {
1505-
(IMetricsService, None): NullMetrics()
1506-
}[(iface, context)],
1507-
help_url=lambda _anchor=None: help_url,
1508-
)
1509-
svc = services.HaveIBeenPwnedPasswordBreachedService.create_service(
1510-
context, request
1511-
)
1512-
assert svc.failure_message_plain == expected
1513-
15141480

15151481
class TestNullPasswordBreachedService:
15161482
def test_verify_service(self):

warehouse/accounts/interfaces.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,6 @@ def unsafe_load_payload(token):
269269

270270
class IPasswordBreachedService(Interface):
271271
failure_message = Attribute("The message to describe the failure that occurred")
272-
failure_message_plain = Attribute(
273-
"The message to describe the failure that occurred in plain text"
274-
)
275272

276273
def check_password(password, *, tags=None):
277274
"""

warehouse/accounts/services.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -815,13 +815,6 @@ def failure_message(self):
815815
)
816816
return message
817817

818-
@property
819-
def failure_message_plain(self):
820-
message = self._failure_message_preamble
821-
if self._help_url:
822-
message += f" See the FAQ entry at {self._help_url} for more information."
823-
return message
824-
825818
def _metrics_increment(self, *args, **kwargs):
826819
self._metrics.increment(*args, **kwargs)
827820

@@ -890,7 +883,6 @@ def check_password(self, password, *, tags=None):
890883
@implementer(IPasswordBreachedService)
891884
class NullPasswordBreachedService:
892885
failure_message = "This password appears in a breach."
893-
failure_message_plain = "This password appears in a breach."
894886

895887
@classmethod
896888
def create_service(cls, context, request):

0 commit comments

Comments
 (0)