Esempio n. 1
0
def test_add_to_objects_timeline():
    with patch("taiga.timeline.service._add_to_object_timeline") as mock:
        users = [User(), User(), User()]
        project = Project()
        service._add_to_objects_timeline(users, project, "test")
        assert mock.call_count == 3
        assert mock.mock_calls == [
            call(users[0], project, "test", "default", {}),
            call(users[1], project, "test", "default", {}),
            call(users[2], project, "test", "default", {}),
        ]
        with pytest.raises(Exception):
            service.push_to_timeline(None, project, "test")
def test_add_to_objects_timeline():
    with patch("taiga.timeline.service._add_to_object_timeline") as mock:
        users = [User(), User(), User()]
        project = Project()
        service._add_to_objects_timeline(users, project, "test")
        assert mock.call_count == 3
        assert mock.mock_calls == [
            call(users[0], project, "test", "default", {}),
            call(users[1], project, "test", "default", {}),
            call(users[2], project, "test", "default", {}),
        ]
        with pytest.raises(Exception):
            service.push_to_timeline(None, project, "test")