def test_reply_to_email(self):
    'Test reply form.'
    url = '{}?action=reply&mbox=INBOX&mailid=46931'.format(reverse('modoboa_webmail:index'))
    session = self.client.session
    session['lastaction'] = 'compose'
    session.save()
    response = self.ajax_get(url)
    self.assertIn('id="id_origmsgid"', response['listing'])
    response = self.client.post(url, {'from_': self.user.email, 'to': 'example@example.com', 'subject': 'test', 'body': 'Test', 'origmsgid': '<id@localhost>'})
    self.assertEqual(len(mail.outbox), 1)
    self.assertEqual(mail.outbox[0].from_email, 'example@example.com')
    self.assertIn('References', mail.outbox[0].extra_headers)
Test reply form.
def test_reply_to_email(self):
    
    url = '{}?action=reply&mbox=INBOX&mailid=46931'.format(reverse('modoboa_webmail:index'))
    session = self.client.session
    session['lastaction'] = 'compose'
    session.save()
    response = self.ajax_get(url)
    self.assertIn('id="id_origmsgid"', response['listing'])
    response = self.client.post(url, {'from_': self.user.email, 'to': 'example@example.com', 'subject': 'test', 'body': 'Test', 'origmsgid': '<id@localhost>'})
    self.assertEqual(len(mail.outbox), 1)
    self.assertEqual(mail.outbox[0].from_email, 'example@example.com')
    self.assertIn('References', mail.outbox[0].extra_headers)