def test_attach_notify_policy_to_project_queryset(): project1 = f.ProjectFactory.create() project2 = f.ProjectFactory.create() qs = project1.__class__.objects.order_by("id") qs = services.attach_notify_policy_to_project_queryset(project1.owner, qs) assert len(qs) == 2 assert qs[0].notify_level == NotifyLevel.notwatch assert qs[1].notify_level == NotifyLevel.notwatch services.create_notify_policy(project1, project1.owner, NotifyLevel.watch) qs = project1.__class__.objects.order_by("id") qs = services.attach_notify_policy_to_project_queryset(project1.owner, qs) assert qs[0].notify_level == NotifyLevel.watch assert qs[1].notify_level == NotifyLevel.notwatch
def test_attach_notify_level_to_project_queryset(): project1 = f.ProjectFactory.create() f.ProjectFactory.create() qs = project1.__class__.objects.order_by("id") qs = utils.attach_notify_level_to_project_queryset(qs, project1.owner) assert len(qs) == 2 assert qs[0].notify_level == NotifyLevel.involved assert qs[1].notify_level == NotifyLevel.involved services.create_notify_policy(project1, project1.owner, NotifyLevel.all) qs = project1.__class__.objects.order_by("id") qs = utils.attach_notify_level_to_project_queryset(qs, project1.owner) assert qs[0].notify_level == NotifyLevel.all assert qs[1].notify_level == NotifyLevel.involved
def test_notify_policy_existence(): project = f.ProjectFactory.create() assert not services.notify_policy_exists(project, project.owner) services.create_notify_policy(project, project.owner, NotifyLevel.all) assert services.notify_policy_exists(project, project.owner)
def test_notify_policy_existence(): project = f.ProjectFactory.create() assert not services.notify_policy_exists(project, project.owner) services.create_notify_policy(project, project.owner, NotifyLevel.watch) assert services.notify_policy_exists(project, project.owner)