diff --git a/django/contrib/auth/templates/auth/widgets/read_only_password_hash.html b/django/contrib/auth/templates/auth/widgets/read_only_password_hash.html
index a2a12c6f10..c73042b18f 100644
--- a/django/contrib/auth/templates/auth/widgets/read_only_password_hash.html
+++ b/django/contrib/auth/templates/auth/widgets/read_only_password_hash.html
@@ -1,5 +1,5 @@
{% for entry in summary %}
-{{ entry.label }}{% if entry.value %}: {{ entry.value }}{% endif %}
+{{ entry.label }}{% if entry.value %}: {{ entry.value }}{% endif %}
{% endfor %}
diff --git a/tests/auth_tests/test_forms.py b/tests/auth_tests/test_forms.py
index ea52254123..98bf264040 100644
--- a/tests/auth_tests/test_forms.py
+++ b/tests/auth_tests/test_forms.py
@@ -1159,14 +1159,13 @@ class ReadOnlyPasswordHashTest(SimpleTestCase):
)
self.assertHTMLEqual(
widget.render("name", value, {"id": "id_password"}),
- """
-
- algorithm: pbkdf2_sha256
- iterations: 100000
- salt: a6Pucb******
- hash: WmCkn9**************************************
-
- """,
+ ''
+ " algorithm: pbkdf2_sha256"
+ " iterations: 100000"
+ " salt: a6Pucb******"
+ " hash: "
+ " WmCkn9**************************************"
+ "
",
)
def test_readonly_field_has_changed(self):
diff --git a/tests/auth_tests/test_views.py b/tests/auth_tests/test_views.py
index 2941716422..5ea536151e 100644
--- a/tests/auth_tests/test_views.py
+++ b/tests/auth_tests/test_views.py
@@ -1519,9 +1519,9 @@ class ChangelistTests(AuthViewsTestCase):
# ReadOnlyPasswordHashWidget is used to render the field.
self.assertContains(
response,
- "algorithm: %s\n\n"
- "salt: %s********************\n\n"
- "hash: %s**************************\n\n"
+ "algorithm: %s\n\n"
+ "salt: %s********************\n\n"
+ "hash: %s**************************\n\n"
% (
algo,
salt[:2],