'The correct spam revisions should show up.'

def test_recent_spam_revisions_show(self, mock_analytics_upageviews):

    doc1 = create_document(save=True)
    doc2 = create_document(save=True)
    rev_doc0 = self.create_revisions(num=1, creator=self.testuser, document=self.document)
    rev_doc1 = self.create_revisions(num=1, creator=self.testuser, document=doc1)
    rev_doc2 = self.create_revisions(num=1, creator=self.testuser, document=doc2)
    created_revisions = ((rev_doc0 + rev_doc1) + rev_doc2)
    for rev in created_revisions:
        rev.created = (datetime.datetime.today() - datetime.timedelta(days=1))
        rev.save()
    for revision in created_revisions:
        revision.akismet_submissions.add(RevisionAkismetSubmission(sender=self.admin, type='spam'))
    self.create_revisions(num=3, creator=self.admin)
    mock_analytics_upageviews.return_value = {rev_doc0[0].id: 0, rev_doc1[0].id: 0, rev_doc2[0].id: 0}
    self.client.login(username='admin', password='testpass')
    response = self.client.get(reverse('dashboards.spam', locale='en-US'))
    eq_(200, response.status_code)
    response2 = self.client.get(reverse('dashboards.spam', locale='en-US'))
    page = pq(response2.content)
    table_rows = page.find('.spam-events-table    tbody    tr')
    table_row_text = ''
    for table_row in table_rows:
        table_row_text += table_row.text_content()
    eq_(len(table_rows), len(created_revisions))
    for revision in created_revisions:
        document_url = reverse('wiki.document', kwargs={'document_path': revision.document.slug})
        ok_((document_url in table_row_text))
