summaryrefslogtreecommitdiff
path: root/tests/get_or_create
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-06-28 11:21:26 -0400
committerTim Graham <timograham@gmail.com>2016-07-01 09:58:56 -0400
commit567cfc1601a5f475eea12bc5de53b849fa5dadea (patch)
treec471ba1af748008e4fbe9faee8cf51d4dffcd263 /tests/get_or_create
parent9c48e17480432b8723fcdcc262d8d62866e93a4f (diff)
[1.10.x] Replaced use of TestCase.fail() with assertRaises().
Also removed try/except/fail antipattern that hides exceptions. Backport of c9ae09addffb839403312131d4251e9d8b454508 from master
Diffstat (limited to 'tests/get_or_create')
-rw-r--r--tests/get_or_create/tests.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/get_or_create/tests.py b/tests/get_or_create/tests.py
index 0f790e67b2..3e87bf0a04 100644
--- a/tests/get_or_create/tests.py
+++ b/tests/get_or_create/tests.py
@@ -193,13 +193,10 @@ class GetOrCreateTestsWithManualPKs(TestCase):
def test_get_or_create_empty(self):
"""
- Regression test for #16137: get_or_create does not require kwargs.
+ If all the attributes on a model have defaults, get_or_create() doesn't
+ require any arguments.
"""
- try:
- DefaultPerson.objects.get_or_create()
- except AssertionError:
- self.fail("If all the attributes on a model have defaults, we "
- "shouldn't need to pass any arguments.")
+ DefaultPerson.objects.get_or_create()
class GetOrCreateTransactionTests(TransactionTestCase):