From 25f9775083161b8b9d583892443bcd3e05130a41 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 19 May 2020 12:24:50 +0200 Subject: [PATCH 1/3] tests: add test on creation of user without email (#43074) --- tests/test_user_manager.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_user_manager.py b/tests/test_user_manager.py index 57341386..11a737c8 100644 --- a/tests/test_user_manager.py +++ b/tests/test_user_manager.py @@ -14,6 +14,9 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . + +from __future__ import unicode_literals + import csv import re import time @@ -42,6 +45,19 @@ def visible_users(response): return set(elt.text for elt in response.pyquery('td.username')) +def test_create_user_no_email(app, superuser): + response = login(app, superuser, '/manage/users/') + response = response.click('Add user') + assert User.objects.count() == 1 + response.form.set('first_name', 'Jôhn') + response.form.set('last_name', 'Döe') + response.form.set('password1', '1234Password') + response.form.set('password2', '1234Password') + response.form.set('send_password_reset', False) + response = response.form.submit(status=302) + assert User.objects.count() == 2 + + def test_manager_user_change_email(app, superuser_or_admin, simple_user, mailoutbox): ou = get_default_ou() ou.validate_emails = True -- 2.26.2