def test_listmailbox(self):
    'Check listmailbox action.'
    url = reverse('modoboa_webmail:index')
    response = self.client.get(url)
    self.assertEqual(response.status_code, 200)
    response = self.client.get('{}?action=listmailbox'.format(url), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    self.assertEqual(response.status_code, 200)
    self.assertIn('example@example.com', response.json()['listing'])
    response = self.client.get('{}?action=listmailbox&pattern=Réception&criteria=Subject'.format(url), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    self.assertEqual(response.status_code, 200)
    self.assertIn('example@example.com', response.json()['listing'])
Check listmailbox action.
def test_listmailbox(self):
    
    url = reverse('modoboa_webmail:index')
    response = self.client.get(url)
    self.assertEqual(response.status_code, 200)
    response = self.client.get('{}?action=listmailbox'.format(url), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    self.assertEqual(response.status_code, 200)
    self.assertIn('example@example.com', response.json()['listing'])
    response = self.client.get('{}?action=listmailbox&pattern=Réception&criteria=Subject'.format(url), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    self.assertEqual(response.status_code, 200)
    self.assertIn('example@example.com', response.json()['listing'])