1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.10.x] Replaced use of TestCase.fail() with assertRaises().

Also removed try/except/fail antipattern that hides exceptions.

Backport of c9ae09addf from master
This commit is contained in:
Tim Graham
2016-06-28 11:21:26 -04:00
parent 9c48e17480
commit 567cfc1601
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):