Beispiel #1
0
    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')
Beispiel #2
0
    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')
Beispiel #3
0
    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')
Beispiel #4
0
    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')
Beispiel #5
0
    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')
Beispiel #6
0
    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')
Beispiel #7
0
    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)
Beispiel #8
0
    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)