-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Give the public group to newly created users
- Loading branch information
Showing
4 changed files
with
45 additions
and
24 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
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 |
---|---|---|
|
@@ -187,3 +187,11 @@ def test_generate_username(first_name: str, last_name: str, expected: str): | |
new_user = User(first_name=first_name, last_name=last_name, email="[email protected]") | ||
new_user.generate_username() | ||
assert new_user.username == expected | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_user_added_to_public_group(): | ||
"""Test that newly created users are added to the public group""" | ||
user = baker.make(User) | ||
assert user.groups.filter(pk=settings.SITH_GROUP_PUBLIC_ID).exists() | ||
assert user.is_in_group(pk=settings.SITH_GROUP_PUBLIC_ID) |
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