summaryrefslogtreecommitdiff
path: root/tests/foreign_object
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-04 08:08:27 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-07 20:37:05 +0100
commit7119f40c9881666b6f9b5cf7df09ee1d21cc8344 (patch)
treefa50869f5614295f462d9bf77fec59365c621609 /tests/foreign_object
parent9c19aff7c7561e3a82978a272ecdaad40dda5c00 (diff)
downloaddjango-7119f40c9881666b6f9b5cf7df09ee1d21cc8344.tar.gz
Refs #33476 -- Refactored code to strictly match 88 characters line length.
Diffstat (limited to 'tests/foreign_object')
-rw-r--r--tests/foreign_object/test_forms.py3
-rw-r--r--tests/foreign_object/tests.py16
2 files changed, 12 insertions, 7 deletions
diff --git a/tests/foreign_object/test_forms.py b/tests/foreign_object/test_forms.py
index 61f8f42295..a3ad74d28b 100644
--- a/tests/foreign_object/test_forms.py
+++ b/tests/foreign_object/test_forms.py
@@ -15,7 +15,8 @@ class FormsTests(TestCase):
fields = "__all__"
def test_foreign_object_form(self):
- # A very crude test checking that the non-concrete fields do not get form fields.
+ # A very crude test checking that the non-concrete fields do not get
+ # form fields.
form = FormsTests.ArticleForm()
self.assertIn("id_pub_date", form.as_table())
self.assertNotIn("active_translation", form.as_table())
diff --git a/tests/foreign_object/tests.py b/tests/foreign_object/tests.py
index 9022fbf9c5..f63abf82bd 100644
--- a/tests/foreign_object/tests.py
+++ b/tests/foreign_object/tests.py
@@ -79,7 +79,8 @@ class MultiColumnFKTests(TestCase):
group_id=self.cia.id,
)
- # Creating an invalid membership because it has a different country has the person
+ # Creating an invalid membership because it has a different country has
+ # the person.
Membership.objects.create(
membership_country_id=self.soviet_union.id,
person_id=self.bob.id,
@@ -289,7 +290,7 @@ class MultiColumnFKTests(TestCase):
membership_country=self.usa, person=self.jim, group=self.cia
)
- # Let's check to make sure that it worked. Bob and Jim should be members of the CIA.
+ # Bob and Jim should be members of the CIA.
self.assertQuerysetEqual(
self.cia.members.all(), ["Bob", "Jim"], attrgetter("name")
@@ -315,7 +316,8 @@ class MultiColumnFKTests(TestCase):
# We start out by making sure that the Group 'CIA' has no members.
self.assertQuerysetEqual(self.cia.members.all(), [])
- # Something adds jane to group CIA but Jane is in Soviet Union which isn't CIA's country
+ # Something adds jane to group CIA but Jane is in Soviet Union which
+ # isn't CIA's country.
Membership.objects.create(
membership_country=self.usa, person=self.jane, group=self.cia
)
@@ -327,7 +329,8 @@ class MultiColumnFKTests(TestCase):
# We start out by making sure that Jane has no groups.
self.assertQuerysetEqual(self.jane.groups.all(), [])
- # Something adds jane to group CIA but Jane is in Soviet Union which isn't CIA's country
+ # Something adds jane to group CIA but Jane is in Soviet Union which
+ # isn't CIA's country.
Membership.objects.create(
membership_country=self.usa, person=self.jane, group=self.cia
)
@@ -352,8 +355,9 @@ class MultiColumnFKTests(TestCase):
def test_m2m_through_on_self_ignores_mismatch_columns(self):
self.assertQuerysetEqual(self.jane.friends.all(), [])
- # Note that we use ids instead of instances. This is because instances on ForeignObject
- # properties will set all related field off of the given instance
+ # Note that we use ids instead of instances. This is because instances
+ # on ForeignObject properties will set all related field off of the
+ # given instance.
Friendship.objects.create(
from_friend_id=self.jane.id,
to_friend_id=self.george.id,