def test_edit_folder(self):
    'Test folder edition.'
    url = reverse('modoboa_webmail:folder_change')
    response = self.client.get(url)
    self.assertContains(response, 'Invalid request')
    url = '{}?name=Test'.format(url)
    response = self.client.get(url)
    self.assertContains(response, 'Edit folder')
    session = self.client.session
    session['webmail_navparams'] = {'inbox': 'Test'}
    session.save()
    response = self.ajax_post(url, {'oldname': 'Test', 'name': 'Toto'})
    self.assertEqual(response['respmsg'], 'Folder updated')
Test folder edition.
def test_edit_folder(self):
    
    url = reverse('modoboa_webmail:folder_change')
    response = self.client.get(url)
    self.assertContains(response, 'Invalid request')
    url = '{}?name=Test'.format(url)
    response = self.client.get(url)
    self.assertContains(response, 'Edit folder')
    session = self.client.session
    session['webmail_navparams'] = {'inbox': 'Test'}
    session.save()
    response = self.ajax_post(url, {'oldname': 'Test', 'name': 'Toto'})
    self.assertEqual(response['respmsg'], 'Folder updated')