summaryrefslogtreecommitdiff
path: root/tests/model_inheritance_regress
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/model_inheritance_regress
parent4bb70cbcc60794f515c9bfefeca87b8272d33c0c (diff)
Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.
Diffstat (limited to 'tests/model_inheritance_regress')
-rw-r--r--tests/model_inheritance_regress/models.py2
-rw-r--r--tests/model_inheritance_regress/tests.py30
2 files changed, 14 insertions, 18 deletions
diff --git a/tests/model_inheritance_regress/models.py b/tests/model_inheritance_regress/models.py
index b5bc75061d..07d5a22c9b 100644
--- a/tests/model_inheritance_regress/models.py
+++ b/tests/model_inheritance_regress/models.py
@@ -167,7 +167,7 @@ class InternalCertificationAudit(CertificationAudit):
auditing_dept = models.CharField(max_length=20)
-# Check that abstract classes don't get m2m tables autocreated.
+# Abstract classes don't get m2m tables autocreated.
@python_2_unicode_compatible
class Person(models.Model):
name = models.CharField(max_length=100)
diff --git a/tests/model_inheritance_regress/tests.py b/tests/model_inheritance_regress/tests.py
index 5299739b08..3664fca44f 100644
--- a/tests/model_inheritance_regress/tests.py
+++ b/tests/model_inheritance_regress/tests.py
@@ -22,10 +22,10 @@ from .models import (
class ModelInheritanceTest(TestCase):
def test_model_inheritance(self):
# Regression for #7350, #7202
- # Check that when you create a Parent object with a specific reference
- # to an existent child instance, saving the Parent doesn't duplicate
- # the child. This behavior is only activated during a raw save - it
- # is mostly relevant to deserialization, but any sort of CORBA style
+ # When you create a Parent object with a specific reference to an
+ # existent child instance, saving the Parent doesn't duplicate the
+ # child. This behavior is only activated during a raw save - it is
+ # mostly relevant to deserialization, but any sort of CORBA style
# 'narrow()' API would require a similar approach.
# Create a child-parent-grandparent chain
@@ -49,7 +49,7 @@ class ModelInheritanceTest(TestCase):
park = ParkingLot(parent=place2, capacity=100)
park.save_base(raw=True)
- # Check that no extra parent objects have been created.
+ # No extra parent objects have been created.
places = list(Place.objects.all())
self.assertEqual(places, [place1, place2])
@@ -325,8 +325,8 @@ class ModelInheritanceTest(TestCase):
assignee="adrian")
def test_abstract_base_class_m2m_relation_inheritance(self):
- # Check that many-to-many relations defined on an abstract base class
- # are correctly inherited (and created) on the child class.
+ # many-to-many relations defined on an abstract base class are
+ # correctly inherited (and created) on the child class.
p1 = Person.objects.create(name='Alice')
p2 = Person.objects.create(name='Bob')
p3 = Person.objects.create(name='Carol')
@@ -348,8 +348,8 @@ class ModelInheritanceTest(TestCase):
parties = list(p2.bachelorparty_set.all())
self.assertEqual(parties, [bachelor])
- # Check that a subclass of a subclass of an abstract model doesn't get
- # its own accessor.
+ # A subclass of a subclass of an abstract model doesn't get its own
+ # accessor.
self.assertFalse(hasattr(p2, 'messybachelorparty_set'))
# ... but it does inherit the m2m from its parent
@@ -410,8 +410,8 @@ class ModelInheritanceTest(TestCase):
def test_inherited_unique_field_with_form(self):
"""
- Test that a model which has different primary key for the parent model
- passes unique field checking correctly. Refs #17615.
+ A model which has different primary key for the parent model passes
+ unique field checking correctly (#17615).
"""
class ProfileForm(forms.ModelForm):
class Meta:
@@ -420,8 +420,7 @@ class ModelInheritanceTest(TestCase):
User.objects.create(username="user_only")
p = Profile.objects.create(username="user_with_profile")
- form = ProfileForm({'username': "user_with_profile", 'extra': "hello"},
- instance=p)
+ form = ProfileForm({'username': "user_with_profile", 'extra': "hello"}, instance=p)
self.assertTrue(form.is_valid())
def test_inheritance_joins(self):
@@ -441,10 +440,7 @@ class ModelInheritanceTest(TestCase):
self.assertEqual(str(qs.query).count('JOIN'), 1)
def test_issue_21554(self):
- senator = Senator.objects.create(
- name='John Doe', title='X', state='Y'
- )
-
+ senator = Senator.objects.create(name='John Doe', title='X', state='Y')
senator = Senator.objects.get(pk=senator.pk)
self.assertEqual(senator.name, 'John Doe')
self.assertEqual(senator.title, 'X')