summaryrefslogtreecommitdiff
path: root/tests/m2m_through_regress
diff options
context:
space:
mode:
authorDražen Odobašić <dodobas@candela-it.com>2015-09-11 19:33:12 -0400
committerTim Graham <timograham@gmail.com>2015-09-12 11:40:50 -0400
commitb1e33ceceda1e75ff68c7deed8f6659683a195d3 (patch)
treee4e446f69194f2dc3c9c7ee3ecf48290ea8d4d31 /tests/m2m_through_regress
parent84b0a8d2aad042fb573df5055b6153770d0929ac (diff)
downloaddjango-b1e33ceceda1e75ff68c7deed8f6659683a195d3.tar.gz
Fixed #23395 -- Limited line lengths to 119 characters.
Diffstat (limited to 'tests/m2m_through_regress')
-rw-r--r--tests/m2m_through_regress/tests.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/m2m_through_regress/tests.py b/tests/m2m_through_regress/tests.py
index 434a84c0d6..025ce11e63 100644
--- a/tests/m2m_through_regress/tests.py
+++ b/tests/m2m_through_regress/tests.py
@@ -105,7 +105,13 @@ class M2MThroughSerializationTestCase(TestCase):
out = StringIO()
management.call_command("dumpdata", "m2m_through_regress", format="json", stdout=out)
- self.assertJSONEqual(out.getvalue().strip(), """[{"pk": %(m_pk)s, "model": "m2m_through_regress.membership", "fields": {"person": %(p_pk)s, "price": 100, "group": %(g_pk)s}}, {"pk": %(p_pk)s, "model": "m2m_through_regress.person", "fields": {"name": "Bob"}}, {"pk": %(g_pk)s, "model": "m2m_through_regress.group", "fields": {"name": "Roll"}}]""" % pks)
+ self.assertJSONEqual(
+ out.getvalue().strip(),
+ '[{"pk": %(m_pk)s, "model": "m2m_through_regress.membership", "fields": {"person": %(p_pk)s, "price": '
+ '100, "group": %(g_pk)s}}, {"pk": %(p_pk)s, "model": "m2m_through_regress.person", "fields": {"name": '
+ '"Bob"}}, {"pk": %(g_pk)s, "model": "m2m_through_regress.group", "fields": {"name": "Roll"}}]'
+ % pks
+ )
out = StringIO()
management.call_command("dumpdata", "m2m_through_regress", format="xml",
@@ -237,7 +243,15 @@ class ThroughLoadDataTestCase(TestCase):
fixtures = ["m2m_through"]
def test_sequence_creation(self):
- "Check that sequences on an m2m_through are created for the through model, not a phantom auto-generated m2m table. Refs #11107"
+ """
+ Sequences on an m2m_through are created for the through model, not a
+ phantom auto-generated m2m table (#11107).
+ """
out = StringIO()
management.call_command("dumpdata", "m2m_through_regress", format="json", stdout=out)
- self.assertJSONEqual(out.getvalue().strip(), """[{"pk": 1, "model": "m2m_through_regress.usermembership", "fields": {"price": 100, "group": 1, "user": 1}}, {"pk": 1, "model": "m2m_through_regress.person", "fields": {"name": "Guido"}}, {"pk": 1, "model": "m2m_through_regress.group", "fields": {"name": "Python Core Group"}}]""")
+ self.assertJSONEqual(
+ out.getvalue().strip(),
+ '[{"pk": 1, "model": "m2m_through_regress.usermembership", "fields": {"price": 100, "group": 1, "user"'
+ ': 1}}, {"pk": 1, "model": "m2m_through_regress.person", "fields": {"name": "Guido"}}, {"pk": 1, '
+ '"model": "m2m_through_regress.group", "fields": {"name": "Python Core Group"}}]'
+ )