mirror of
https://github.com/django/django.git
synced 2025-11-01 12:25:37 +00:00
Fixed E124 pep8 warnings.
This commit is contained in:
parent
0873200e7f
commit
a2814846ca
45 changed files with 371 additions and 262 deletions
|
|
@ -45,14 +45,16 @@ class GetOrCreateTests(TestCase):
|
|||
|
||||
# If you don't specify a value or default value for all required
|
||||
# fields, you will get an error.
|
||||
self.assertRaises(IntegrityError,
|
||||
self.assertRaises(
|
||||
IntegrityError,
|
||||
Person.objects.get_or_create, first_name="Tom", last_name="Smith"
|
||||
)
|
||||
|
||||
# If you specify an existing primary key, but different other fields,
|
||||
# then you will get an error and data will not be updated.
|
||||
ManualPrimaryKeyTest.objects.create(id=1, data="Original")
|
||||
self.assertRaises(IntegrityError,
|
||||
self.assertRaises(
|
||||
IntegrityError,
|
||||
ManualPrimaryKeyTest.objects.get_or_create, id=1, data="Different"
|
||||
)
|
||||
self.assertEqual(ManualPrimaryKeyTest.objects.get(id=1).data, "Original")
|
||||
|
|
@ -181,7 +183,8 @@ class UpdateOrCreateTests(TestCase):
|
|||
# If you specify an existing primary key, but different other fields,
|
||||
# then you will get an error and data will not be updated.
|
||||
ManualPrimaryKeyTest.objects.create(id=1, data="Original")
|
||||
self.assertRaises(IntegrityError,
|
||||
self.assertRaises(
|
||||
IntegrityError,
|
||||
ManualPrimaryKeyTest.objects.update_or_create, id=1, data="Different"
|
||||
)
|
||||
self.assertEqual(ManualPrimaryKeyTest.objects.get(id=1).data, "Original")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue