Don't test to add users since registration is disabled
This commit is contained in:
parent
34766257b3
commit
e75f04b530
|
@ -1,7 +1,6 @@
|
||||||
# -*- mode: python; coding: utf-8 -*-
|
# -*- mode: python; coding: utf-8 -*-
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from django.core import mail
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from users.models import User
|
from users.models import User
|
||||||
|
@ -23,19 +22,3 @@ class TemplateTests(TestCase):
|
||||||
def test_users_user_changelist(self):
|
def test_users_user_changelist(self):
|
||||||
response = self.client.get(reverse('admin:users_user_changelist'))
|
response = self.client.get(reverse('admin:users_user_changelist'))
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
def test_users_user_add_init_mail(self):
|
|
||||||
"""
|
|
||||||
Test that an initialization mail is send when a new user is added
|
|
||||||
"""
|
|
||||||
data = {
|
|
||||||
'username': "test_user",
|
|
||||||
'email': "test@example.com",
|
|
||||||
'first_name': "Test",
|
|
||||||
'last_name': "User",
|
|
||||||
}
|
|
||||||
response = self.client.post(reverse(
|
|
||||||
'admin:users_user_add',
|
|
||||||
), data=data)
|
|
||||||
self.assertEqual(len(mail.outbox), 1)
|
|
||||||
self.assertEqual(response.status_code, 302)
|
|
||||||
|
|
Loading…
Reference in New Issue