mirror of https://github.com/django/django.git
Fixed #31992 -- Made admin password reset templates use title/content_title blocks from the base template.
This commit is contained in:
parent
1db8d8e3a9
commit
53c0d16ac1
|
@ -8,8 +8,6 @@
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block title %}{{ title }}{% endblock %}
|
|
||||||
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<p>{% translate 'Your password was changed.' %}</p>
|
<p>{% translate 'Your password was changed.' %}</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -9,9 +9,6 @@
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block title %}{{ title }}{% endblock %}
|
|
||||||
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}<div id="content-main">
|
{% block content %}<div id="content-main">
|
||||||
|
|
||||||
<form method="post">{% csrf_token %}
|
<form method="post">{% csrf_token %}
|
||||||
|
|
|
@ -8,9 +8,6 @@
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block title %}{{ title }}{% endblock %}
|
|
||||||
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<p>{% translate "Your password has been set. You may go ahead and log in now." %}</p>
|
<p>{% translate "Your password has been set. You may go ahead and log in now." %}</p>
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block title %}{{ title }}{% endblock %}
|
|
||||||
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% if validlink %}
|
{% if validlink %}
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block title %}{{ title }}{% endblock %}
|
|
||||||
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<p>{% translate 'We’ve emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly.' %}</p>
|
<p>{% translate 'We’ve emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly.' %}</p>
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block title %}{{ title }}{% endblock %}
|
|
||||||
{% block content_title %}<h1>{{ title }}</h1>{% endblock %}
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<p>{% translate 'Forgotten your password? Enter your email address below, and we’ll email instructions for setting a new one.' %}</p>
|
<p>{% translate 'Forgotten your password? Enter your email address below, and we’ll email instructions for setting a new one.' %}</p>
|
||||||
|
|
|
@ -26,12 +26,12 @@ class AuthTemplateTests(TestCase):
|
||||||
|
|
||||||
def test_PasswordResetView(self):
|
def test_PasswordResetView(self):
|
||||||
response = PasswordResetView.as_view(success_url='dummy/')(self.request)
|
response = PasswordResetView.as_view(success_url='dummy/')(self.request)
|
||||||
self.assertContains(response, '<title>Password reset</title>')
|
self.assertContains(response, '<title>Password reset | Django site admin</title>')
|
||||||
self.assertContains(response, '<h1>Password reset</h1>')
|
self.assertContains(response, '<h1>Password reset</h1>')
|
||||||
|
|
||||||
def test_PasswordResetDoneView(self):
|
def test_PasswordResetDoneView(self):
|
||||||
response = PasswordResetDoneView.as_view()(self.request)
|
response = PasswordResetDoneView.as_view()(self.request)
|
||||||
self.assertContains(response, '<title>Password reset sent</title>')
|
self.assertContains(response, '<title>Password reset sent | Django site admin</title>')
|
||||||
self.assertContains(response, '<h1>Password reset sent</h1>')
|
self.assertContains(response, '<h1>Password reset sent</h1>')
|
||||||
|
|
||||||
def test_PasswordResetConfirmView_invalid_token(self):
|
def test_PasswordResetConfirmView_invalid_token(self):
|
||||||
|
@ -39,7 +39,7 @@ class AuthTemplateTests(TestCase):
|
||||||
client = PasswordResetConfirmClient()
|
client = PasswordResetConfirmClient()
|
||||||
url = reverse('password_reset_confirm', kwargs={'uidb64': 'Bad', 'token': 'Bad-Token'})
|
url = reverse('password_reset_confirm', kwargs={'uidb64': 'Bad', 'token': 'Bad-Token'})
|
||||||
response = client.get(url)
|
response = client.get(url)
|
||||||
self.assertContains(response, '<title>Password reset unsuccessful</title>')
|
self.assertContains(response, '<title>Password reset unsuccessful | Django site admin</title>')
|
||||||
self.assertContains(response, '<h1>Password reset unsuccessful</h1>')
|
self.assertContains(response, '<h1>Password reset unsuccessful</h1>')
|
||||||
|
|
||||||
def test_PasswordResetConfirmView_valid_token(self):
|
def test_PasswordResetConfirmView_valid_token(self):
|
||||||
|
@ -50,7 +50,7 @@ class AuthTemplateTests(TestCase):
|
||||||
uidb64 = urlsafe_base64_encode(str(self.user.pk).encode())
|
uidb64 = urlsafe_base64_encode(str(self.user.pk).encode())
|
||||||
url = reverse('password_reset_confirm', kwargs={'uidb64': uidb64, 'token': token})
|
url = reverse('password_reset_confirm', kwargs={'uidb64': uidb64, 'token': token})
|
||||||
response = client.get(url)
|
response = client.get(url)
|
||||||
self.assertContains(response, '<title>Enter new password</title>')
|
self.assertContains(response, '<title>Enter new password | Django site admin</title>')
|
||||||
self.assertContains(response, '<h1>Enter new password</h1>')
|
self.assertContains(response, '<h1>Enter new password</h1>')
|
||||||
# The username is added to the password reset confirmation form to help
|
# The username is added to the password reset confirmation form to help
|
||||||
# browser's password managers.
|
# browser's password managers.
|
||||||
|
@ -61,15 +61,15 @@ class AuthTemplateTests(TestCase):
|
||||||
|
|
||||||
def test_PasswordResetCompleteView(self):
|
def test_PasswordResetCompleteView(self):
|
||||||
response = PasswordResetCompleteView.as_view()(self.request)
|
response = PasswordResetCompleteView.as_view()(self.request)
|
||||||
self.assertContains(response, '<title>Password reset complete</title>')
|
self.assertContains(response, '<title>Password reset complete | Django site admin</title>')
|
||||||
self.assertContains(response, '<h1>Password reset complete</h1>')
|
self.assertContains(response, '<h1>Password reset complete</h1>')
|
||||||
|
|
||||||
def test_PasswordResetChangeView(self):
|
def test_PasswordResetChangeView(self):
|
||||||
response = PasswordChangeView.as_view(success_url='dummy/')(self.request)
|
response = PasswordChangeView.as_view(success_url='dummy/')(self.request)
|
||||||
self.assertContains(response, '<title>Password change</title>')
|
self.assertContains(response, '<title>Password change | Django site admin</title>')
|
||||||
self.assertContains(response, '<h1>Password change</h1>')
|
self.assertContains(response, '<h1>Password change</h1>')
|
||||||
|
|
||||||
def test_PasswordChangeDoneView(self):
|
def test_PasswordChangeDoneView(self):
|
||||||
response = PasswordChangeDoneView.as_view()(self.request)
|
response = PasswordChangeDoneView.as_view()(self.request)
|
||||||
self.assertContains(response, '<title>Password change successful</title>')
|
self.assertContains(response, '<title>Password change successful | Django site admin</title>')
|
||||||
self.assertContains(response, '<h1>Password change successful</h1>')
|
self.assertContains(response, '<h1>Password change successful</h1>')
|
||||||
|
|
Loading…
Reference in New Issue