From 2346995cb397c6d7be65490e1173a50e123f846d Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Mon, 17 Feb 2020 14:20:38 -0800 Subject: [PATCH] Remove bottle-formula validation test This is not really necessary and only serves as validation that will need to updated if model choices ever change. --- core/models.py | 7 ------- core/tests/tests_forms.py | 9 +-------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/core/models.py b/core/models.py index 36758d26..d0d54e2b 100644 --- a/core/models.py +++ b/core/models.py @@ -252,13 +252,6 @@ class Feeding(models.Model): validate_duration(self) validate_unique_period(Feeding.objects.filter(child=self.child), self) - # "Formula" Type may only be associated with "Bottle" Method. - if self.type == 'formula' and self.method != 'bottle': - raise ValidationError( - {'method': - _('Only "Bottle" method is allowed with "Formula" type.')}, - code='bottle_formula_mismatch') - class Note(models.Model): model_name = 'note' diff --git a/core/tests/tests_forms.py b/core/tests/tests_forms.py index 7951320e..26c949a6 100644 --- a/core/tests/tests_forms.py +++ b/core/tests/tests_forms.py @@ -263,16 +263,9 @@ class FeedingFormsTestCase(FormsTestCaseBase): 'start': self.localtime_string(start), 'end': self.localtime_string(end), 'type': 'formula', - 'method': 'left breast', + 'method': 'bottle', 'amount': 0 } - page = self.c.post('/feedings/add/', params) - self.assertEqual(page.status_code, 200) - self.assertFormError( - page, 'form', 'method', - 'Only "Bottle" method is allowed with "Formula" type.') - - params.update({'method': 'bottle'}) page = self.c.post('/feedings/add/', params, follow=True) self.assertEqual(page.status_code, 200) self.assertContains(