@pytest.fixture
def moderator_user(user, forum, default_groups):
 user = User(username='test_mod', email='test_mod@example.org', password='test', primary_group=default_groups[2], activated=True)
 user.save()
 forum.moderators.append(user)
 forum.save()
 return user

@ pytest . fixture def moderator_user ( user , forum , default_groups ) : user = User ( username = 'test_mod' , email = 'test_mod@example.org' , password = 'test' , primary_group = default_groups [ 2 ] , activated = True ) user . save ( ) forum . moderators . append ( user ) forum . save ( ) return user
creates a test user with moderator permissions .