'Preview the thread post.'

def test_preview(self):

    u = UserFactory()
    self.client.login(username=u.username, password='testpass')
    d = DocumentFactory()
    num_threads = d.thread_set.count()
    content = 'Full    of    awesome.'
    response = post(self.client, 'wiki.discuss.new_thread', {'title': 'Topic', 'content': content, 'preview': 'any    string'}, args=[d.slug])
    eq_(200, response.status_code)
    doc = pq(response.content)
    eq_(content, doc('#post-preview    div.content').text())
    eq_(num_threads, d.thread_set.count())
