'Delete link should not appear on summary page sometimes.
This should occur if: 1.) The user did not create the document or
2.) the document has other revisions.
This test goes through situation 1.)
The places in the template where this link may occur are:
1.) Reverted or 2.) New action by user or 3.) Already identified as spam.
Check all of these places in this test.'

def test_delete_link_does_not_appear_summary_page_no_create_doc(self):

    revisions_already_spam = self.create_revisions(num=1, document=self.document, creator=self.testuser)
    self.client.login(username='admin', password='testpass')
    ban_url = reverse('users.ban_user_and_cleanup_summary', kwargs={'username': self.testuser.username})
    full_ban_url = self.client.get(ban_url)['Location']
    data = {'revision-already-spam': [revisions_already_spam[0].id]}
    resp = self.client.post(full_ban_url, data=data)
    eq_(200, resp.status_code)
    page = pq(resp.content)
    delete_url = reverse('wiki.delete_document', kwargs={'document_path': self.document.slug}, force_locale=True)
    delete_link_already_spam_section = page.find('#already-spam    a[href="{url}"]'.format(url=delete_url))
    eq_(len(delete_link_already_spam_section), 0)
