def test_get_participants(self): organization = self.create_organization(owner=self.create_user()) team = self.create_team(organization=organization) project = self.create_project(organization=organization, team=team) group = self.create_group(project=project) actor = self.create_user() other = self.create_user() for user in (actor, other): self.create_member([team], user=user, organization=organization) GroupSubscription.objects.subscribe(group, user) email = ActivityEmail( Activity( project=group.project, group=group, user=actor, ) ) assert email.get_participants() == set([other]) UserOption.objects.set_value( user=actor, project=None, key='self_notifications', value='1' ) assert email.get_participants() == set([actor, other])
def test_get_participants(self): group, (actor, other) = self.get_fixture_data(2) email = ActivityEmail(Activity(project=group.project, group=group, user=actor)) assert set(email.get_participants()) == set([other]) UserOption.objects.set_value(user=actor, key="self_notifications", value="1") assert set(email.get_participants()) == set([actor, other])
def test_get_participants(self): group, (actor, other) = self.get_fixture_data(2) email = ActivityEmail(Activity( project=group.project, group=group, user=actor, )) assert set(email.get_participants()) == set([other]) UserOption.objects.set_value(user=actor, key='self_notifications', value='1') assert set(email.get_participants()) == set([actor, other])
def test_get_participants_without_actor(self): group, (user, ) = self.get_fixture_data(1) email = ActivityEmail(Activity( project=group.project, group=group, )) assert set(email.get_participants()) == set([user])