From 4e0ff351466fc2d74cc8d1d40ea78da2b3859d0d Mon Sep 17 00:00:00 2001 From: Julien Phalip Date: Sat, 27 Jul 2013 19:50:02 -0700 Subject: Fixed #11195 -- Added CSS classes to the changelist cells to allow style customizations. Thanks to akaihola, Ramiro Morales and vdboor for their work on the patch. --- tests/admin_changelist/tests.py | 6 +++--- tests/admin_views/tests.py | 26 +++++++++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/admin_changelist/tests.py b/tests/admin_changelist/tests.py index 7f3f0d162e..fb72f60b7c 100644 --- a/tests/admin_changelist/tests.py +++ b/tests/admin_changelist/tests.py @@ -91,7 +91,7 @@ class ChangeListTests(TestCase): context = Context({'cl': cl}) table_output = template.render(context) link = reverse('admin:admin_changelist_child_change', args=(new_child.id,)) - row_html = 'name(None)' % link + row_html = 'name(None)' % link self.assertFalse(table_output.find(row_html) == -1, 'Failed to find expected row element: %s' % table_output) @@ -114,7 +114,7 @@ class ChangeListTests(TestCase): context = Context({'cl': cl}) table_output = template.render(context) link = reverse('admin:admin_changelist_child_change', args=(new_child.id,)) - row_html = 'nameParent object' % link + row_html = 'nameParent object' % link self.assertFalse(table_output.find(row_html) == -1, 'Failed to find expected row element: %s' % table_output) @@ -150,7 +150,7 @@ class ChangeListTests(TestCase): # make sure that list editable fields are rendered in divs correctly editable_name_field = '' - self.assertInHTML('%s' % editable_name_field, table_output, msg_prefix='Failed to find "name" list_editable field') + self.assertInHTML('%s' % editable_name_field, table_output, msg_prefix='Failed to find "name" list_editable field') def test_result_list_editable(self): """ diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 7decf6f471..80fdb90402 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -1496,7 +1496,7 @@ class AdminViewStringPrimaryKeyTest(TestCase): response = self.client.get(prefix) # this URL now comes through reverse(), thus url quoting and iri_to_uri encoding pk_final_url = escape(iri_to_uri(urlquote(quote(self.pk)))) - should_contain = """%s""" % (prefix, pk_final_url, escape(self.pk)) + should_contain = """%s""" % (prefix, pk_final_url, escape(self.pk)) self.assertContains(response, should_contain) def test_recentactions_link(self): @@ -2151,8 +2151,8 @@ class AdminViewListEditable(TestCase): self.assertContains(response, 'id="id_form-0-id"', 1) # Only one hidden field, in a separate place than the table. self.assertContains(response, 'id="id_form-1-id"', 1) self.assertContains(response, '
\n\n
' % (story2.id, story1.id), html=True) - self.assertContains(response, '%d' % story1.id, 1) - self.assertContains(response, '%d' % story2.id, 1) + self.assertContains(response, '%d' % story1.id, 1) + self.assertContains(response, '%d' % story2.id, 1) def test_pk_hidden_fields_with_list_display_links(self): """ Similarly as test_pk_hidden_fields, but when the hidden pk fields are @@ -2167,8 +2167,8 @@ class AdminViewListEditable(TestCase): self.assertContains(response, 'id="id_form-0-id"', 1) # Only one hidden field, in a separate place than the table. self.assertContains(response, 'id="id_form-1-id"', 1) self.assertContains(response, '
\n\n
' % (story2.id, story1.id), html=True) - self.assertContains(response, '%d' % (link1, story1.id), 1) - self.assertContains(response, '%d' % (link2, story2.id), 1) + self.assertContains(response, '%d' % (link1, story1.id), 1) + self.assertContains(response, '%d' % (link2, story2.id), 1) @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) @@ -3877,6 +3877,22 @@ class CSSTest(TestCase): self.assertContains(response, '') + self.assertContains( + response, '') + self.assertContains( + response, '') + + try: import docutils except ImportError: -- cgit v1.3