mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Replaced use of TestCase.fail() with assertRaises().
Also removed try/except/fail antipattern that hides exceptions.
This commit is contained in:
parent
c1b6f554e4
commit
c9ae09addf
30 changed files with 205 additions and 447 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue