From ccf94663808871c1ca220d1461f0c715e04d0d4b Mon Sep 17 00:00:00 2001 From: James Turk Date: Wed, 1 Apr 2015 17:43:10 -0400 Subject: [PATCH] assert error occurs on baddata --- lifting/tests.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lifting/tests.py b/lifting/tests.py index a82af2d..43cad03 100644 --- a/lifting/tests.py +++ b/lifting/tests.py @@ -36,10 +36,8 @@ class TestFitnotesImport(TestCase): def test_bad_import(self): # good db then bad db, should fail without screwing up existing data import_fitnotes_db('lifting/testdata/example.fitnotes') - try: + with self.assertRaises(Exception): # baddata.fitnotes has all exercise ids set to 9999 import_fitnotes_db('lifting/testdata/baddata.fitnotes') - except Exception: - pass assert Exercise.objects.count() == 2 assert Set.objects.count() == 9