summaryrefslogtreecommitdiff
path: root/tests/admin_inlines
diff options
context:
space:
mode:
authorza <za@python.or.id>2016-10-27 14:53:39 +0700
committerTim Graham <timograham@gmail.com>2016-11-10 21:30:21 -0500
commit321e94fa41b121f65c02119c02098df327bbd569 (patch)
treece5476c191d589aca4b124f841dfbccac8dd299f /tests/admin_inlines
parent4bb70cbcc60794f515c9bfefeca87b8272d33c0c (diff)
Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.
Diffstat (limited to 'tests/admin_inlines')
-rw-r--r--tests/admin_inlines/tests.py45
1 files changed, 18 insertions, 27 deletions
diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py
index 5871f16a3b..2716d2abdb 100644
--- a/tests/admin_inlines/tests.py
+++ b/tests/admin_inlines/tests.py
@@ -107,8 +107,8 @@ class TestInline(TestDataMixin, TestCase):
def test_tabular_non_field_errors(self):
"""
- Ensure that non_field_errors are displayed correctly, including the
- right value for colspan. Refs #13510.
+ non_field_errors are displayed correctly, including the correct value
+ for colspan.
"""
data = {
'title_set-TOTAL_FORMS': 1,
@@ -153,9 +153,8 @@ class TestInline(TestDataMixin, TestCase):
def test_help_text(self):
"""
- Ensure that the inlines' model field help texts are displayed when
- using both the stacked and tabular layouts.
- Ref #8190.
+ The inlines' model field help texts are displayed when using both the
+ stacked and tabular layouts.
"""
response = self.client.get(reverse('admin:admin_inlines_holder4_add'))
self.assertContains(response, '<div class="help">Awesome stacked help text is awesome.</div>', 4)
@@ -191,8 +190,7 @@ class TestInline(TestDataMixin, TestCase):
def test_non_related_name_inline(self):
"""
- Ensure that multiple inlines with related_name='+' have correct form
- prefixes. Bug #16838.
+ Multiple inlines with related_name='+' have correct form prefixes.
"""
response = self.client.get(reverse('admin:admin_inlines_capofamiglia_add'))
self.assertContains(response, '<input type="hidden" name="-1-0-id" id="id_-1-0-id" />', html=True)
@@ -221,8 +219,8 @@ class TestInline(TestDataMixin, TestCase):
@override_settings(USE_L10N=True, USE_THOUSAND_SEPARATOR=True)
def test_localize_pk_shortcut(self):
"""
- Ensure that the "View on Site" link is correct for locales that use
- thousand separators
+ The "View on Site" link is correct for locales that use thousand
+ separators.
"""
holder = Holder.objects.create(pk=123456789, dummy=42)
inner = Inner.objects.create(pk=987654321, holder=holder, dummy=42, readonly='')
@@ -232,8 +230,8 @@ class TestInline(TestDataMixin, TestCase):
def test_custom_pk_shortcut(self):
"""
- Ensure that the "View on Site" link is correct for models with a
- custom primary key field. Bug #18433.
+ The "View on Site" link is correct for models with a custom primary key
+ field.
"""
parent = ParentModelWithCustomPk.objects.create(my_own_pk="foo", name="Foo")
child1 = ChildModel1.objects.create(my_own_pk="bar", name="Bar", parent=parent)
@@ -246,8 +244,7 @@ class TestInline(TestDataMixin, TestCase):
def test_create_inlines_on_inherited_model(self):
"""
- Ensure that an object can be created with inlines when it inherits
- another class. Bug #19524.
+ An object can be created with inlines when it inherits another class.
"""
data = {
'name': 'Martian',
@@ -285,7 +282,7 @@ class TestInline(TestDataMixin, TestCase):
def test_min_num(self):
"""
- Ensure that min_num and extra determine number of forms.
+ min_num and extra determine number of forms.
"""
class MinNumInline(TabularInline):
model = BinaryTree
@@ -309,9 +306,6 @@ class TestInline(TestDataMixin, TestCase):
self.assertContains(response, total_forms)
def test_custom_min_num(self):
- """
- Ensure that get_min_num is called and used correctly.
- """
bt_head = BinaryTree.objects.create(name="Tree Head")
BinaryTree.objects.create(name="First Child", parent=bt_head)
@@ -741,8 +735,7 @@ class SeleniumTests(AdminSeleniumTestCase):
def test_add_stackeds(self):
"""
- Ensure that the "Add another XXX" link correctly adds items to the
- stacked formset.
+ The "Add another XXX" link correctly adds items to the stacked formset.
"""
self.admin_login(username='super', password='secret')
self.selenium.get(self.live_server_url + reverse('admin:admin_inlines_holder4_add'))
@@ -781,14 +774,12 @@ class SeleniumTests(AdminSeleniumTestCase):
def test_add_inlines(self):
"""
- Ensure that the "Add another XXX" link correctly adds items to the
- inline form.
+ The "Add another XXX" link correctly adds items to the inline form.
"""
self.admin_login(username='super', password='secret')
self.selenium.get(self.live_server_url + reverse('admin:admin_inlines_profilecollection_add'))
- # Check that there's only one inline to start with and that it has the
- # correct ID.
+ # There's only one inline to start with and it has the correct ID.
self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set')), 1)
self.assertEqual(self.selenium.find_elements_by_css_selector(
@@ -802,8 +793,8 @@ class SeleniumTests(AdminSeleniumTestCase):
# Add an inline
self.selenium.find_element_by_link_text('Add another Profile').click()
- # Check that the inline has been added, that it has the right id, and
- # that it contains the right fields.
+ # The inline has been added, it has the right id, and it contains the
+ # correct fields.
self.assertEqual(len(self.selenium.find_elements_by_css_selector('.dynamic-profile_set')), 2)
self.assertEqual(self.selenium.find_elements_by_css_selector(
'.dynamic-profile_set')[1].get_attribute('id'), 'profile_set-1')
@@ -833,7 +824,7 @@ class SeleniumTests(AdminSeleniumTestCase):
self.selenium.find_element_by_xpath('//input[@value="Save"]').click()
self.wait_page_loaded()
- # Check that the objects have been created in the database
+ # The objects have been created in the database
self.assertEqual(ProfileCollection.objects.all().count(), 1)
self.assertEqual(Profile.objects.all().count(), 3)
@@ -864,7 +855,7 @@ class SeleniumTests(AdminSeleniumTestCase):
'form#profilecollection_form tr.dynamic-profile_set#profile_set-1 td.delete a').click()
self.selenium.find_element_by_css_selector(
'form#profilecollection_form tr.dynamic-profile_set#profile_set-2 td.delete a').click()
- # Verify that they're gone and that the IDs have been re-sequenced
+ # The rows are gone and the IDs have been re-sequenced
self.assertEqual(len(self.selenium.find_elements_by_css_selector(
'#profile_set-group table tr.dynamic-profile_set')), 3)
self.assertEqual(len(self.selenium.find_elements_by_css_selector(