From 382ec1d63b47137990f7ef62dcf62d91bc6032fb Mon Sep 17 00:00:00 2001 From: James Turk Date: Wed, 1 Apr 2015 17:47:41 -0400 Subject: [PATCH] import w/ other data --- lifting/tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lifting/tests.py b/lifting/tests.py index 43cad03..17f811a 100644 --- a/lifting/tests.py +++ b/lifting/tests.py @@ -33,6 +33,15 @@ class TestFitnotesImport(TestCase): assert Exercise.objects.count() == 2 assert Set.objects.count() == 9 + def test_import_with_other_data(self): + Exercise.objects.create(names=['incline bench press']) + e = Exercise.objects.create(names=['flat barbell bench press']) + Set.objects.create(exercise=e, weight_kg=100, reps=10, date='2014-01-01') + import_fitnotes_db('lifting/testdata/example.fitnotes') + assert Exercise.objects.count() == 3 + assert Set.objects.count() == 10 + + def test_bad_import(self): # good db then bad db, should fail without screwing up existing data import_fitnotes_db('lifting/testdata/example.fitnotes')