Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mediatek
Base de données Mediatek
Commits
e75f04b5
Verified
Commit
e75f04b5
authored
Nov 14, 2021
by
ynerant
Browse files
Don't test to add users since registration is disabled
parent
34766257
Pipeline
#9541
passed with stages
in 2 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
users/tests/test_templates.py
View file @
e75f04b5
# -*- mode: python; coding: utf-8 -*-
# SPDX-License-Identifier: GPL-3.0-or-later
from
django.core
import
mail
from
django.test
import
TestCase
from
django.urls
import
reverse
from
users.models
import
User
...
...
@@ -23,19 +22,3 @@ class TemplateTests(TestCase):
def
test_users_user_changelist
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'admin:users_user_changelist'
))
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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment