From f4f60363eb43e0e3e29c91a11aa52618fe34c3b2 Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Fri, 27 May 2022 16:29:43 -0700 Subject: [PATCH] Add import/export tests for recent model additions --- core/tests/import/bmi.csv | 6 ++++++ core/tests/import/headcircumference.csv | 6 ++++++ core/tests/import/height.csv | 6 ++++++ core/tests/import/tag.csv | 11 +++++++++++ core/tests/tests_import_export.py | 12 ++++++++++++ 5 files changed, 41 insertions(+) create mode 100644 core/tests/import/bmi.csv create mode 100644 core/tests/import/headcircumference.csv create mode 100644 core/tests/import/height.csv create mode 100644 core/tests/import/tag.csv diff --git a/core/tests/import/bmi.csv b/core/tests/import/bmi.csv new file mode 100644 index 00000000..0cc65c7d --- /dev/null +++ b/core/tests/import/bmi.csv @@ -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,, diff --git a/core/tests/import/headcircumference.csv b/core/tests/import/headcircumference.csv new file mode 100644 index 00000000..5187cd82 --- /dev/null +++ b/core/tests/import/headcircumference.csv @@ -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,, diff --git a/core/tests/import/height.csv b/core/tests/import/height.csv new file mode 100644 index 00000000..ab57b009 --- /dev/null +++ b/core/tests/import/height.csv @@ -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,, diff --git a/core/tests/import/tag.csv b/core/tests/import/tag.csv new file mode 100644 index 00000000..052cb7a6 --- /dev/null +++ b/core/tests/import/tag.csv @@ -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 diff --git a/core/tests/tests_import_export.py b/core/tests/tests_import_export.py index 79ccb8ab..49e30c50 100644 --- a/core/tests/tests_import_export.py +++ b/core/tests/tests_import_export.py @@ -38,6 +38,9 @@ class ImportTestCase(TestCase): self.assertFalse(result.has_errors()) self.assertEqual(model.objects.count(), count) + def test_bmi(self): + self.import_data(models.BMI, 5) + def test_child(self): self.import_data(models.Child, 2) @@ -47,6 +50,12 @@ class ImportTestCase(TestCase): def test_feeding(self): 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): self.import_data(models.Note, 1) @@ -56,6 +65,9 @@ class ImportTestCase(TestCase): def test_sleep(self): self.import_data(models.Sleep, 39) + def test_tag(self): + self.import_data(models.Tag, 10) + def test_temperature(self): self.import_data(models.Temperature, 23)