-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overwrite role name w/hybrid property
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
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
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
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 |
---|---|---|
|
@@ -7,6 +7,23 @@ | |
from . import have_same_elements | ||
|
||
|
||
def test_role_name_property(session, make_role, make_user_and_role): | ||
r1 = make_role(name="foo") | ||
u, r2 = make_user_and_role(email="[email protected]") | ||
|
||
# Verify private role name references user | ||
assert r1.name == "foo" | ||
assert r2.name == "private role for [email protected]" | ||
|
||
# Update user's email | ||
u.email = "[email protected]" | ||
session.add(u) | ||
session.commit() | ||
|
||
# Verify private role name references updated user's email | ||
assert r2.name == "private role for [email protected]" | ||
|
||
|
||
def test_get_npns_roles(session, make_role): | ||
make_role(deleted=True) | ||
make_role(type=Role.types.PRIVATE) | ||
|