def test_text_intro_with_just_heading_passes_validation(self): block = TextIntroduction() value = block.to_python({'heading': 'Heading'}) try: block.clean(value) except ValidationError: self.fail('heading without eyebrow should not fail validation')
def test_text_intro_without_eyebrow_or_heading_passes_validation(self): block = TextIntroduction() value = block.to_python({}) try: block.clean(value) except ValidationError: self.fail('no heading and no eyebrow should not fail validation')
def test_text_intro_with_heading_and_eyebrow_passes_validation(self): block = TextIntroduction() value = block.to_python({'heading': 'Heading', 'eyebrow': 'Eyebrow'}) try: block.clean(value) except ValidationError: self.fail('eyebrow with heading should not fail validation')
def test_text_intro_with_heading_and_eyebrow_passes_validation(self): block = TextIntroduction() value = block.to_python({ 'heading': 'Heading', 'eyebrow': 'Eyebrow' }) try: block.clean(value) except ValidationError: self.fail('eyebrow with heading should not fail validation')
def test_text_intro_with_eyebrow_but_no_heading_fails_validation(self): block = TextIntroduction() value = block.to_python({'eyebrow': 'Eyebrow'}) with self.assertRaises(ValidationError): block.clean(value)