'HTTP POST to new revision URL creates the revision on a document.
The document in this case already has a current_revision, therefore
the document document fields are not editable.
Also assert that the edited and reviewable notifications go out.'

@override_settings(TIDINGS_CONFIRM_ANONYMOUS_WATCHES=False)
@mock.patch.object(Site.objects, 'get_current')
def test_new_revision_POST_document_with_current(self, get_current):

    get_current.return_value.domain = 'testserver'
    EditDocumentEvent.notify('sam@example.com', self.d).activate().save()
    data = {'summary': 'A    brief    summary', 'content': 'The    article    content', 'keywords': 'keyword1    keyword2', 'slug': self.d.slug, 'toc_depth': 1, 'based_on': self.d.current_revision.id, 'form-type': 'rev'}
    edit_url = reverse('wiki.edit', args=[self.d.slug])
    response = self.client.post(edit_url, data)
    ok_((response.status_code in (200, 302)))
    eq_(2, self.d.revisions.count())
    new_rev = self.d.revisions.order_by('-id')[0]
    eq_(self.d.current_revision, new_rev.based_on)
    time.sleep(1)
    eq_(2, len(mail.outbox))
    first_edit_email = mail.outbox[0]
    expected_to = [config.EMAIL_LIST_SPAM_WATCH]
    expected_subject = (u'[MDN][%(loc)s]    %(user)s    made    their    first    edit,    to:    %(title)s' % {'loc': self.d.locale, 'user': new_rev.creator.username, 'title': self.d.title})
    eq_(expected_subject, first_edit_email.subject)
    eq_(expected_to, first_edit_email.to)
    edited_email = mail.outbox[1]
    expected_to = [u'sam@example.com']
    expected_subject = (u'[MDN][en-US]    Page    "%s"    changed    by    %s' % (self.d.title, new_rev.creator))
    eq_(expected_subject, edited_email.subject)
    eq_(expected_to, edited_email.to)
    ok_((('%s    changed    %s.' % (unicode(self.username), unicode(self.d.title))) in edited_email.body))
    ok_(((u'https://testserver/en-US/docs/%s$history?utm_campaign=' % self.d.slug) in edited_email.body))
