-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: multiple emails and phone_numbers
- Loading branch information
Showing
9 changed files
with
40 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,9 +22,9 @@ def populate(app): | |
family_name="Doe", | ||
user_name="admin", | ||
display_name="Jane.D", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="admin", | ||
phone_numbers="555-000-000", | ||
phone_numbers=["555-000-000"], | ||
profile_url="https://admin.example", | ||
formatted_address="123, Admin Lane - Gotham City 12345", | ||
street="Admin Lane", | ||
|
@@ -42,9 +42,9 @@ def populate(app): | |
family_name="Doe", | ||
user_name="moderator", | ||
display_name="👮 Jack 👮", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="moderator", | ||
phone_numbers="555-000-002", | ||
phone_numbers=["555-000-002"], | ||
profile_url="https://moderator.example", | ||
employee_number="1002", | ||
department_number="west", | ||
|
@@ -57,9 +57,9 @@ def populate(app): | |
family_name="Doe", | ||
user_name="user", | ||
display_name="Johnny", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="user", | ||
phone_numbers="555-000-001", | ||
phone_numbers=["555-000-001"], | ||
profile_url="https://user.example", | ||
employee_number="1001", | ||
department_number="west", | ||
|
@@ -71,7 +71,7 @@ def populate(app): | |
given_name="James", | ||
family_name="Doe", | ||
user_name="james", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
) | ||
james.save() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ def test_object_creation(app, backend): | |
formatted_name="Doe", # leading space | ||
family_name="Doe", | ||
user_name="user", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
) | ||
assert not user.exists | ||
user.save() | ||
|
@@ -41,7 +41,7 @@ def test_dn_when_leading_space_in_id_attribute(testclient, backend): | |
formatted_name=" Doe", # leading space | ||
family_name=" Doe", | ||
user_name=" user", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
) | ||
user.save() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,34 +135,34 @@ def test_model_indexation(testclient, backend): | |
|
||
assert models.User.get(family_name="family_name") == user | ||
assert not models.User.get(family_name="new_family_name") | ||
assert models.User.get(emails="[email protected]") == user | ||
assert models.User.get(emails="[email protected]") == user | ||
assert not models.User.get(emails="[email protected]") | ||
assert models.User.get(emails=["[email protected]"]) == user | ||
assert models.User.get(emails=["[email protected]"]) == user | ||
assert not models.User.get(emails=["[email protected]"]) | ||
|
||
user.family_name = "new_family_name" | ||
user.emails = ["[email protected]"] | ||
|
||
assert models.User.get(family_name="family_name") != user | ||
assert not models.User.get(family_name="new_family_name") | ||
assert models.User.get(emails="[email protected]") != user | ||
assert models.User.get(emails="[email protected]") != user | ||
assert not models.User.get(emails="[email protected]") | ||
assert models.User.get(emails=["[email protected]"]) != user | ||
assert models.User.get(emails=["[email protected]"]) != user | ||
assert not models.User.get(emails=["[email protected]"]) | ||
|
||
user.save() | ||
|
||
assert not models.User.get(family_name="family_name") | ||
assert models.User.get(family_name="new_family_name") == user | ||
assert not models.User.get(emails="[email protected]") | ||
assert models.User.get(emails="[email protected]") == user | ||
assert not models.User.get(emails="[email protected]") | ||
assert not models.User.get(emails=["[email protected]"]) | ||
assert models.User.get(emails=["[email protected]"]) == user | ||
assert not models.User.get(emails=["[email protected]"]) | ||
|
||
user.delete() | ||
|
||
assert not models.User.get(family_name="family_name") | ||
assert not models.User.get(family_name="new_family_name") | ||
assert not models.User.get(emails="[email protected]") | ||
assert not models.User.get(emails="[email protected]") | ||
assert not models.User.get(emails="[email protected]") | ||
assert not models.User.get(emails=["[email protected]"]) | ||
assert not models.User.get(emails=["[email protected]"]) | ||
assert not models.User.get(emails=["[email protected]"]) | ||
|
||
|
||
def test_fuzzy(user, moderator, admin, backend): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,11 +142,11 @@ def user(app, backend): | |
given_name="John", | ||
family_name="Doe", | ||
user_name="user", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="correct horse battery staple", | ||
display_name="Johnny", | ||
preferred_language="en", | ||
phone_numbers="555-000-000", | ||
phone_numbers=["555-000-000"], | ||
profile_url="https://john.example", | ||
formatted_address="1235, somewhere", | ||
) | ||
|
@@ -162,7 +162,7 @@ def admin(app, backend): | |
formatted_name="Jane Doe", | ||
family_name="Doe", | ||
user_name="admin", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="admin", | ||
) | ||
u.save() | ||
|
@@ -177,7 +177,7 @@ def moderator(app, backend): | |
formatted_name="Jack Doe", | ||
family_name="Doe", | ||
user_name="moderator", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="moderator", | ||
) | ||
u.save() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,7 +163,7 @@ def test_first_login_account_initialization_mail_sending_failed( | |
formatted_name="Temp User", | ||
family_name="Temp", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
) | ||
u.save() | ||
|
||
|
@@ -185,7 +185,7 @@ def test_first_login_form_error(testclient, backend, smtpd): | |
formatted_name="Temp User", | ||
family_name="Temp", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
) | ||
u.save() | ||
|
||
|
@@ -207,7 +207,7 @@ def test_user_password_deleted_during_login(testclient, backend): | |
formatted_name="Temp User", | ||
family_name="Temp", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="correct horse battery staple", | ||
) | ||
u.save() | ||
|
@@ -231,7 +231,7 @@ def test_user_deleted_in_session(testclient, backend): | |
formatted_name="Jake Doe", | ||
family_name="Jake", | ||
user_name="jake", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="correct horse battery staple", | ||
) | ||
u.save() | ||
|
@@ -290,7 +290,7 @@ def test_admin_self_deletion(testclient, backend): | |
formatted_name="Temp admin", | ||
family_name="admin", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="admin", | ||
) | ||
admin.save() | ||
|
@@ -316,7 +316,7 @@ def test_user_self_deletion(testclient, backend): | |
formatted_name="Temp user", | ||
family_name="user", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="correct horse battery staple", | ||
) | ||
user.save() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ def test_group_deletion(testclient, backend): | |
formatted_name="foobar", | ||
family_name="foobar", | ||
user_name="foobar", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
) | ||
user.save() | ||
|
||
|
@@ -111,7 +111,7 @@ def test_set_groups_with_leading_space_in_user_id_attribute(app, foo_group): | |
formatted_name=" Doe", # leading space in id attribute | ||
family_name="Doe", | ||
user_name="user2", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
) | ||
user.save() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ def test_user_has_password(testclient, backend): | |
formatted_name="Temp User", | ||
family_name="Temp", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
) | ||
u.save() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,7 +130,7 @@ def test_password_initialization_mail(smtpd, testclient, backend, logged_admin): | |
formatted_name="Temp User", | ||
family_name="Temp", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
) | ||
u.save() | ||
|
||
|
@@ -166,7 +166,7 @@ def test_password_initialization_mail_send_fail( | |
formatted_name="Temp User", | ||
family_name="Temp", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
) | ||
u.save() | ||
|
||
|
@@ -236,7 +236,7 @@ def test_password_reset_email(smtpd, testclient, backend, logged_admin): | |
formatted_name="Temp User", | ||
family_name="Temp", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="correct horse battery staple", | ||
) | ||
u.save() | ||
|
@@ -264,7 +264,7 @@ def test_password_reset_email_failed(SMTP, smtpd, testclient, backend, logged_ad | |
formatted_name="Temp User", | ||
family_name="Temp", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password=["correct horse battery staple"], | ||
) | ||
u.save() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -826,7 +826,7 @@ def test_code_with_invalid_user(testclient, admin, client): | |
formatted_name="John Doe", | ||
family_name="Doe", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="correct horse battery staple", | ||
) | ||
user.save() | ||
|
@@ -876,7 +876,7 @@ def test_refresh_token_with_invalid_user(testclient, client): | |
formatted_name="John Doe", | ||
family_name="Doe", | ||
user_name="temp", | ||
emails="[email protected]", | ||
emails=["[email protected]"], | ||
password="correct horse battery staple", | ||
) | ||
user.save() | ||
|