Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
6dafa1ff
Verified
Commit
6dafa1ff
authored
Jan 05, 2022
by
Baptiste Beauplat
Browse files
Add unit test for lookup_user_from_address
parent
fc05e7e0
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/unit/accounts/test_user.py
View file @
6dafa1ff
...
...
@@ -62,3 +62,17 @@ class TestUser(TestCase):
'password'
)
self
.
assertTrue
(
user
.
is_staff
)
self
.
assertTrue
(
user
.
is_superuser
)
def
test_lookup_user
(
self
):
for
unknown_email
in
(
None
,
''
,
'unknown@example.org'
,):
self
.
assertEquals
(
None
,
User
.
objects
.
lookup_user_from_address
(
unknown_email
)
)
user
=
User
.
objects
.
create_user
(
'email@example.com'
,
'test user'
,
'password'
)
self
.
assertEquals
(
User
.
objects
.
lookup_user_from_address
(
'User <email@example.com>'
),
user
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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