Bump version to 1.3.6 and update NEWS.rst for 1.3.5
[mailman-postorious.git] / src / postorius / tests / test_domain_view.py
blobf2a1f013db507b4ebad2ab7fc83a3e2ad79b382b
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2012-2021 by the Free Software Foundation, Inc.
4 # This file is part of Postorius.
6 # Postorius is free software: you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free
8 # Software Foundation, either version 3 of the License, or (at your option)
9 # any later version.
10 # Postorius is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 # more details.
15 # You should have received a copy of the GNU General Public License along with
16 # Postorius. If not, see <http://www.gnu.org/licenses/>.
19 from django.contrib.auth.models import User
20 from django.test import TestCase
21 from django.urls import reverse
23 from allauth.account.models import EmailAddress
25 from postorius.forms import DomainForm
28 class DomainViewTest(TestCase):
30 def setUp(self):
31 self.user = User.objects.create_superuser('su', 'su@example.com',
32 'pass')
33 EmailAddress.objects.create(
34 user=self.user, email=self.user.email, verified=True)
36 def tearDown(self):
37 self.user.delete()
39 def test_form_is_rendered(self):
40 self.client.login(username='su', password='pass')
41 response = self.client.get(reverse('domain_new'), follow=True)
42 self.assertEqual(response.status_code, 200)
43 self.assertIsInstance(response.context['form'], DomainForm)