mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Give the public group to newly created users
This commit is contained in:
@ -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="a@example.com")
|
||||
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)
|
||||
|
Reference in New Issue
Block a user