Fixed #34617 -- Enabled user zooming on mobile devices in the admin.

This commit is contained in:
Cheuk Ting Ho 2023-06-01 13:37:25 +01:00 committed by GitHub
parent 4037223d0f
commit 65da6b2ae4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -16,7 +16,7 @@
{% if LANGUAGE_BIDI %}<link rel="stylesheet" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}">{% endif %}
{% block extrahead %}{% endblock %}
{% block responsive %}
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{% static "admin/css/responsive.css" %}">
{% if LANGUAGE_BIDI %}<link rel="stylesheet" href="{% static "admin/css/responsive_rtl.css" %}">{% endif %}
{% endblock %}

View File

@ -1505,6 +1505,13 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
response, '<div class="help" id="id_new_password1_helptext">'
)
def test_enable_zooming_on_mobile(self):
response = self.client.get(reverse("admin:index"))
self.assertContains(
response,
'<meta name="viewport" content="width=device-width, initial-scale=1.0">',
)
@override_settings(
AUTH_PASSWORD_VALIDATORS=[