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

@ -44,9 +44,5 @@ class SwappableModelTests(TestCase):
@override_settings(TEST_ARTICLE_MODEL='swappable_models.article')
def test_case_insensitive(self):
"Model names are case insensitive. Check that model swapping honors this."
try:
Article.objects.all()
except AttributeError:
self.fail('Swappable model names should be case insensitive.')
Article.objects.all()
self.assertIsNone(Article._meta.swapped)