1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Replaced use of TestCase.fail() with assertRaises().

Also removed try/except/fail antipattern that hides exceptions.
This commit is contained in:
Tim Graham
2016-06-28 11:21:26 -04:00
committed by GitHub
parent c1b6f554e4
commit c9ae09addf
30 changed files with 205 additions and 447 deletions

View File

@@ -2621,14 +2621,10 @@ class UnionTests(unittest.TestCase):
class DefaultValuesInsertTest(TestCase):
def test_no_extra_params(self):
# Ticket #17056 -- affects Oracle
try:
DumbCategory.objects.create()
except TypeError:
self.fail(
"Creation of an instance of a model with only the PK field "
"shouldn't error out after bulk insert refactoring (#17056)"
)
"""
Can create an instance of a model with only the PK field (#17056)."
"""
DumbCategory.objects.create()
class ExcludeTests(TestCase):