def METHOD_NAME(self):
    """Verify documents are sorted by display_order and number of helpful votes."""
    # Create topic, product and documents.
    p = ProductFactory()
    t = TopicFactory(product=p)
    docs = []
    # FIXME: Can't we do this with create_batch and build the document
    # in the approvedrevisionfactory
    for i in range(3):
        doc = DocumentFactory(products=[p], topics=[t])
        ApprovedRevisionFactory(document=doc)
        docs.append(doc)
    # Add a lower display order to the second document. It should be first now.
    docs[1].display_order = 0
    docs[1].save()
    url = reverse("products.documents", args=[p.slug, t.slug])
    r = self.client.get(url, follow=True)
    self.assertEqual(200, r.status_code)
    doc = pq(r.content)
    self.assertEqual(
        doc("#document-list > section > article:first-child > div > h2 > a").text(),
        docs[1].title,
    )
    # Add a helpful vote to the third document. It should be second now.
    rev = docs[2].current_revision
    HelpfulVoteFactory(revision=rev, helpful=True)
    docs[2].save()  # Votes don't trigger a reindex.
    cache.clear()  # documents_for() is cached
    url = reverse("products.documents", args=[p.slug, t.slug])
    r = self.client.get(url, follow=True)
    self.assertEqual(200, r.status_code)
    doc = pq(r.content)
    self.assertEqual(
        doc("#document-list > section > article:nth-child(2) > div > h2> a").text(),
        docs[2].title,
    )
    # Add 2 helpful votes the first document. It should be second now.
    rev = docs[0].current_revision
    HelpfulVoteFactory(revision=rev, helpful=True)
    HelpfulVoteFactory(revision=rev, helpful=True)
    docs[0].save()  # Votes don't trigger a reindex.
    cache.clear()  # documents_for() is cached
    r = self.client.get(url, follow=True)
    self.assertEqual(200, r.status_code)
    doc = pq(r.content)
    self.assertEqual(
        doc("#document-list > section > article:nth-child(2) > div > h2").text(), docs[0].title
    )