Commit 1727e7d4 authored by Aurélien Bompard's avatar Aurélien Bompard

Fix tests and PEP8 errors

parent 35f712be
Pipeline #4104846 failed with stage
in 3 minutes and 1 second
......@@ -21,7 +21,7 @@ from allauth.account.models import EmailAddress
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from postorius.forms import DomainNew
from postorius.forms import DomainForm
class DomainViewTest(TestCase):
......@@ -39,4 +39,4 @@ class DomainViewTest(TestCase):
self.client.login(username='su', password='pass')
response = self.client.get(reverse('domain_new'), follow=True)
self.assertEquals(response.status_code, 200)
self.assertIsInstance(response.context['form'], DomainNew)
self.assertIsInstance(response.context['form'], DomainForm)
......@@ -20,7 +20,7 @@ from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from postorius.forms import (
ChangeSubscriptionForm, DomainNew, ListIdentityForm, ListNew,
ChangeSubscriptionForm, DomainForm, ListIdentityForm, ListNew,
ListSubscribe, UserPreferences)
......@@ -39,10 +39,11 @@ class UserPreferencesTest(TestCase):
class DomainNewTest(TestCase):
def test_form_fields_valid(self):
form = DomainNew({
form = DomainForm({
'mail_host': 'mailman.most-desirable.org',
'description': 'The Most Desirable organization',
'contact_address': 'contact@mailman.most-desirable.org',
'site': 1,
})
self.assertTrue(form.is_valid())
......
......@@ -26,7 +26,6 @@ from django.forms.widgets import HiddenInput
from django.http import Http404
from django.shortcuts import render, redirect
from django.utils.translation import gettext as _
from django_mailman3.lib.mailman import get_mailman_client
from django_mailman3.models import MailDomain
try:
from urllib2 import HTTPError
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment