mirror of
https://github.com/django/django.git
synced 2025-01-03 06:55:47 +00:00
Fixed #34919 -- Added scope attribute to admindocs model templates.
This commit is contained in:
parent
ad41f1c53a
commit
bdf30b952c
@ -32,9 +32,9 @@
|
||||
<table class="model">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% translate 'Field' %}</th>
|
||||
<th>{% translate 'Type' %}</th>
|
||||
<th>{% translate 'Description' %}</th>
|
||||
<th scope="col">{% translate 'Field' %}</th>
|
||||
<th scope="col">{% translate 'Type' %}</th>
|
||||
<th scope="col">{% translate 'Description' %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -55,9 +55,9 @@
|
||||
<table class="model">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% translate 'Method' %}</th>
|
||||
<th>{% translate 'Arguments' %}</th>
|
||||
<th>{% translate 'Description' %}</th>
|
||||
<th scope="col">{% translate 'Method' %}</th>
|
||||
<th scope="col">{% translate 'Arguments' %}</th>
|
||||
<th scope="col">{% translate 'Description' %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -27,7 +27,7 @@
|
||||
<table class="xfull">
|
||||
{% for model in group.list %}
|
||||
<tr>
|
||||
<th><a href="{% url 'django-admindocs-models-detail' app_label=model.app_label model_name=model.model_name %}">{{ model.object_name }}</a></th>
|
||||
<th scope="col"><a href="{% url 'django-admindocs-models-detail' app_label=model.app_label model_name=model.model_name %}">{{ model.object_name }}</a></th>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
@ -240,6 +240,20 @@ class TestModelDetailView(TestDataMixin, AdminDocsTestCase):
|
||||
reverse("django-admindocs-models-detail", args=["admin_docs", "Person"])
|
||||
)
|
||||
|
||||
def test_table_headers(self):
|
||||
tests = [
|
||||
("Method", 1),
|
||||
("Arguments", 1),
|
||||
("Description", 2),
|
||||
("Field", 1),
|
||||
("Type", 1),
|
||||
("Method", 1),
|
||||
]
|
||||
for table_header, count in tests:
|
||||
self.assertContains(
|
||||
self.response, f'<th scope="col">{table_header}</th>', count=count
|
||||
)
|
||||
|
||||
def test_method_excludes(self):
|
||||
"""
|
||||
Methods that begin with strings defined in
|
||||
|
Loading…
Reference in New Issue
Block a user