def test_section_to_re_no_heading():
    section = ListSection(heading='',
                          contents=[
                              'You are a native German speaker',
                              'You love self-management',
                          ])

    assert sections_parser.section_to_re(section).pattern == (
        r'\s*'
        r'(?:\W{1,2} )?You\ are\ a\ native\ German\ speaker'
        r'\s+'
        r'(?:\W{1,2} )?You\ love\ self\-management'
        r'\s*')
def test_section_to_re_no_contents(section):
    with pytest.raises(ValueError):
        sections_parser.section_to_re(section)