diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-03-07 09:35:59 -0800 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-03-09 12:34:32 +0100 |
| commit | eb77e80de01e658541d4fcc3b0b38783ce4e6a7e (patch) | |
| tree | 6869c01ea81c831ea04e2daa9cfd93b54de9754f /tests | |
| parent | ec292f261d2390f692d5534ca85a427216bc4e39 (diff) | |
Fixed #31349 -- Used :nth-child() CSS pseudo-class to style alternative rows in admin.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/admin_changelist/tests.py | 2 | ||||
| -rw-r--r-- | tests/admin_inlines/tests.py | 14 | ||||
| -rw-r--r-- | tests/admin_views/templates/admin/admin_views/article/change_list_results.html | 2 |
3 files changed, 2 insertions, 16 deletions
diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py index fa29886160..1d55813e22 100644 --- a/tests/admin_changelist/tests.py +++ b/tests/admin_changelist/tests.py @@ -40,7 +40,7 @@ from .models import ( def build_tbody_html(pk, href, extra_fields): return ( - '<tbody><tr class="row1">' + '<tbody><tr>' '<td class="action-checkbox">' '<input type="checkbox" name="_selected_action" value="{}" ' 'class="action-select"></td>' diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py index 95eb7104ab..2ddad4f5e7 100644 --- a/tests/admin_inlines/tests.py +++ b/tests/admin_inlines/tests.py @@ -1205,20 +1205,6 @@ class SeleniumTests(AdminSeleniumTestCase): self.assertEqual(len(self.selenium.find_elements_by_css_selector( 'form#profilecollection_form tr.dynamic-profile_set#profile_set-2')), 1) - def test_alternating_rows(self): - self.admin_login(username='super', password='secret') - self.selenium.get(self.live_server_url + reverse('admin:admin_inlines_profilecollection_add')) - - # Add a few inlines - self.selenium.find_element_by_link_text('Add another Profile').click() - self.selenium.find_element_by_link_text('Add another Profile').click() - - row_selector = 'form#profilecollection_form tr.dynamic-profile_set' - self.assertEqual(len(self.selenium.find_elements_by_css_selector( - "%s.row1" % row_selector)), 2, msg="Expect two row1 styled rows") - self.assertEqual(len(self.selenium.find_elements_by_css_selector( - "%s.row2" % row_selector)), 1, msg="Expect one row2 styled row") - def test_collapsed_inlines(self): # Collapsed inlines have SHOW/HIDE links. self.admin_login(username='super', password='secret') diff --git a/tests/admin_views/templates/admin/admin_views/article/change_list_results.html b/tests/admin_views/templates/admin/admin_views/article/change_list_results.html index ca36f3abcf..775641233f 100644 --- a/tests/admin_views/templates/admin/admin_views/article/change_list_results.html +++ b/tests/admin_views/templates/admin/admin_views/article/change_list_results.html @@ -30,7 +30,7 @@ {% if result.form.non_field_errors %} <tr><td colspan="{{ result|length }}">{{ result.form.non_field_errors }}</td></tr> {% endif %} -<tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr> +<tr>{% for item in result %}{{ item }}{% endfor %}</tr> {% endfor %} </tbody> </table> |
