def test_rejects_invalid_ordering(self): form = ExperimentOrderingForm({"ordering": "invalid ordering"}) self.assertFalse(form.is_valid())
def test_accepts_valid_ordering(self): ordering = ExperimentOrderingForm.ORDERING_CHOICES[1][0] form = ExperimentOrderingForm({"ordering": ordering}) self.assertTrue(form.is_valid())