'Make sure sample extraction works from the model.
This is a smaller version of the test from test_content.py'

def test_code_sample_extraction(self):

    sample_html = u'<p    class="foo">Hello    world!</p>'
    sample_css = u'.foo    p    {    color:    red;    }'
    sample_js = u'window.alert("Hi    there!");'
    doc_src = (u'\n                                                <p>This    is    a    page.    Deal    with    it.</p>\n                                                <ul    id="s2"    class="code-sample">\n                                                                <li><pre    class="brush:    html">%s</pre></li>\n                                                                <li><pre    class="brush:    css">%s</pre></li>\n                                                                <li><pre    class="brush:    js">%s</pre></li>\n                                                </ul>\n                                                <p>More    content    shows    up    here.</p>\n                                ' % (escape(sample_html), escape(sample_css), escape(sample_js)))
    rev = revision(is_approved=True, save=True, content=doc_src)
    result = rev.document.extract.code_sample('s2')
    eq_(sample_html.strip(), result['html'].strip())
    eq_(sample_css.strip(), result['css'].strip())
    eq_(sample_js.strip(), result['js'].strip())
