def test_post_phase(phase_factory, user): phase, module, project, _ = setup_phase(phase_factory, None, phases.StatementPhase) anonymous, moderator, initiator = setup_users(project) assert project.is_public with freeze_post_phase(phase): assert not rules.has_perm(perm_name, anonymous, module) assert not rules.has_perm(perm_name, user, module) assert not rules.has_perm(perm_name, moderator, module) assert not rules.has_perm(perm_name, initiator, module)
def test_post_phase_project_archived(phase_factory, idea_factory, user): phase, _, project, item = setup_phase(phase_factory, idea_factory, phases.RatingPhase, module__project__is_archived=True) anonymous, moderator, initiator = setup_users(project) assert project.is_archived with freeze_post_phase(phase): assert not rules.has_perm(perm_name, anonymous, item) assert not rules.has_perm(perm_name, user, item) assert rules.has_perm(perm_name, moderator, item) assert rules.has_perm(perm_name, initiator, item)
def test_post_phase_project_archived(phase_factory, user): phase, module, project, _ = setup_phase(phase_factory, None, phases.CollectPhase, module__project__is_archived=True) anonymous, moderator, initiator = setup_users(project) assert project.is_archived with freeze_post_phase(phase): assert not rules.has_perm(perm_name, anonymous, module) assert not rules.has_perm(perm_name, user, module) assert rules.has_perm(perm_name, moderator, module) assert rules.has_perm(perm_name, initiator, module)
def test_post_phase_project_archived(phase_factory, poll_factory, question, choice, vote, user): phase, module, project, _ = setup_phase(phase_factory, poll_factory, phases.VotingPhase, module__project__is_archived=True) anonymous, moderator, initiator = setup_users(project) assert project.is_archived with freeze_post_phase(phase): assert not rules.has_perm(perm_name, anonymous, module) assert not rules.has_perm(perm_name, user, module) assert rules.has_perm(perm_name, moderator, module) assert rules.has_perm(perm_name, initiator, module)
def test_post_phase_project_archived(phase_factory, chapter_factory, paragraph_factory, user): phase, _, project, item = setup_phase(phase_factory, chapter_factory, phases.CommentPhase, module__project__is_archived=True) anonymous, moderator, initiator = setup_users(project) paragraph = paragraph_factory(chapter=item) assert project.is_archived with freeze_post_phase(phase): assert rules.has_perm(perm_name, anonymous, paragraph) assert rules.has_perm(perm_name, user, paragraph) assert rules.has_perm(perm_name, moderator, paragraph) assert rules.has_perm(perm_name, initiator, paragraph)
def test_post_phase_project_archived(phase_factory, topic_factory, user): phase, _, project, item = setup_phase(phase_factory, topic_factory, phases.PrioritizePhase, module__project__is_archived=True) anonymous, moderator, initiator = setup_users(project) creator = item.creator assert project.is_archived with freeze_post_phase(phase): assert not rules.has_perm(perm_name, anonymous, item) assert not rules.has_perm(perm_name, user, item) assert not rules.has_perm(perm_name, creator, item) assert rules.has_perm(perm_name, moderator, item) assert rules.has_perm(perm_name, initiator, item)