import w/ other data
This commit is contained in:
parent
ccf9466380
commit
382ec1d63b
@ -33,6 +33,15 @@ class TestFitnotesImport(TestCase):
|
|||||||
assert Exercise.objects.count() == 2
|
assert Exercise.objects.count() == 2
|
||||||
assert Set.objects.count() == 9
|
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):
|
def test_bad_import(self):
|
||||||
# good db then bad db, should fail without screwing up existing data
|
# good db then bad db, should fail without screwing up existing data
|
||||||
import_fitnotes_db('lifting/testdata/example.fitnotes')
|
import_fitnotes_db('lifting/testdata/example.fitnotes')
|
||||||
|
Loading…
Reference in New Issue
Block a user