def test_event_manager_publish():
    """Test that EventManager publishing to clients works"""
    saved_data = {
        "user_id": None,
        "title": "asdf",
        "content": "asdf",
        "team_id": None,
        "user": None,
        "team": None,
        "date": "2019-01-28T01:20:46.017649+00:00",
        "id": 10,
    }

    event_manager = EventManager()
    q = defaultdict(Queue)
    event_manager.clients[id(q)] = q
    event_manager.publish(data=saved_data, type="notification", channel="ctf")

    event = event_manager.clients[id(q)]["ctf"].get()
    event = ServerSentEvent(**event)
    assert event.data == saved_data
Test that EventManager publishing to clients works
tests/utils/test_events.py