Add import/export tests for recent model additions

This commit is contained in:
Christopher C. Wells 2022-05-27 16:29:43 -07:00 committed by Christopher Charbonneau Wells
parent 3af2aee093
commit f4f60363eb
5 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,6 @@
id,child_id,child_first_name,child_last_name,bmi,date,notes,tags
5,1,Jasmin,Burke,11.85,2022-05-25,,"3,5,8"
4,1,Jasmin,Burke,11.68,2022-05-18,Car sign by southern American former somebody. Work these billion the indicate local nation. Letter difficult power focus fly line husband employee. Space official property old official.,"1,3,4,8"
3,1,Jasmin,Burke,11.38,2022-05-11,,
2,1,Jasmin,Burke,11.27,2022-05-04,,
1,1,Jasmin,Burke,11.0,2022-04-26,,
1 id child_id child_first_name child_last_name bmi date notes tags
2 5 1 Jasmin Burke 11.85 2022-05-25 3,5,8
3 4 1 Jasmin Burke 11.68 2022-05-18 Car sign by southern American former somebody. Work these billion the indicate local nation. Letter difficult power focus fly line husband employee. Space official property old official. 1,3,4,8
4 3 1 Jasmin Burke 11.38 2022-05-11
5 2 1 Jasmin Burke 11.27 2022-05-04
6 1 1 Jasmin Burke 11.0 2022-04-26

View File

@ -0,0 +1,6 @@
id,child_id,child_first_name,child_last_name,head_circumference,date,notes,tags
5,1,Jasmin,Burke,11.9,2022-05-25,,
4,1,Jasmin,Burke,11.63,2022-05-18,Who even care. Account so heavy level business blood by. Friend right set pressure notice. Likely myself public notice money their. Receive special whose can idea now rest.,"1,2,4,5"
3,1,Jasmin,Burke,11.33,2022-05-11,,"6,10"
2,1,Jasmin,Burke,11.19,2022-05-04,,"7,8"
1,1,Jasmin,Burke,10.96,2022-04-26,,
1 id child_id child_first_name child_last_name head_circumference date notes tags
2 5 1 Jasmin Burke 11.9 2022-05-25
3 4 1 Jasmin Burke 11.63 2022-05-18 Who even care. Account so heavy level business blood by. Friend right set pressure notice. Likely myself public notice money their. Receive special whose can idea now rest. 1,2,4,5
4 3 1 Jasmin Burke 11.33 2022-05-11 6,10
5 2 1 Jasmin Burke 11.19 2022-05-04 7,8
6 1 1 Jasmin Burke 10.96 2022-04-26

View File

@ -0,0 +1,6 @@
id,child_id,child_first_name,child_last_name,height,date,notes,tags
5,1,Jasmin,Burke,9.43,2022-05-25,,
4,1,Jasmin,Burke,9.24,2022-05-18,,
3,1,Jasmin,Burke,9.05,2022-05-11,,"3,4,6,7"
2,1,Jasmin,Burke,8.87,2022-05-04,,"5,6,9,10"
1,1,Jasmin,Burke,8.64,2022-04-26,,
1 id child_id child_first_name child_last_name height date notes tags
2 5 1 Jasmin Burke 9.43 2022-05-25
3 4 1 Jasmin Burke 9.24 2022-05-18
4 3 1 Jasmin Burke 9.05 2022-05-11 3,4,6,7
5 2 1 Jasmin Burke 8.87 2022-05-04 5,6,9,10
6 1 1 Jasmin Burke 8.64 2022-04-26

11
core/tests/import/tag.csv Normal file
View File

@ -0,0 +1,11 @@
id,child_id,child_first_name,child_last_name,name,slug,color,last_used
4,,,,everybody,everybody,#0000ff,2022-05-27 23:20:42
2,,,,lot,lot,#7fffff,2022-05-27 23:20:42
10,,,,method,method,#ffff00,2022-05-27 23:20:42
6,,,,military,military,#ffff7f,2022-05-27 23:20:43
1,,,,our,our,#ff7f7f,2022-05-27 23:20:43
7,,,,surface,surface,#ffff7f,2022-05-27 23:20:42
8,,,,table,table,#7f7fff,2022-05-27 23:20:43
5,,,,ten,ten,#7f7fff,2022-05-27 23:20:43
9,,,,treatment,treatment,#0000ff,2022-05-27 23:20:43
3,,,,you,you,#007f7f,2022-05-27 23:20:42
1 id child_id child_first_name child_last_name name slug color last_used
2 4 everybody everybody #0000ff 2022-05-27 23:20:42
3 2 lot lot #7fffff 2022-05-27 23:20:42
4 10 method method #ffff00 2022-05-27 23:20:42
5 6 military military #ffff7f 2022-05-27 23:20:43
6 1 our our #ff7f7f 2022-05-27 23:20:43
7 7 surface surface #ffff7f 2022-05-27 23:20:42
8 8 table table #7f7fff 2022-05-27 23:20:43
9 5 ten ten #7f7fff 2022-05-27 23:20:43
10 9 treatment treatment #0000ff 2022-05-27 23:20:43
11 3 you you #007f7f 2022-05-27 23:20:42

View File

@ -38,6 +38,9 @@ class ImportTestCase(TestCase):
self.assertFalse(result.has_errors()) self.assertFalse(result.has_errors())
self.assertEqual(model.objects.count(), count) self.assertEqual(model.objects.count(), count)
def test_bmi(self):
self.import_data(models.BMI, 5)
def test_child(self): def test_child(self):
self.import_data(models.Child, 2) self.import_data(models.Child, 2)
@ -47,6 +50,12 @@ class ImportTestCase(TestCase):
def test_feeding(self): def test_feeding(self):
self.import_data(models.Feeding, 40) self.import_data(models.Feeding, 40)
def test_headercircumference(self):
self.import_data(models.HeadCircumference, 5)
def test_height(self):
self.import_data(models.Height, 5)
def test_note(self): def test_note(self):
self.import_data(models.Note, 1) self.import_data(models.Note, 1)
@ -56,6 +65,9 @@ class ImportTestCase(TestCase):
def test_sleep(self): def test_sleep(self):
self.import_data(models.Sleep, 39) self.import_data(models.Sleep, 39)
def test_tag(self):
self.import_data(models.Tag, 10)
def test_temperature(self): def test_temperature(self):
self.import_data(models.Temperature, 23) self.import_data(models.Temperature, 23)