@pytest.mark.eventstore
def test_that_events_can_be_raised_from_within_aggregates(test_domain):
    identifier = str(uuid4())
    UserCommandHandler().register_user(Register(id=identifier, email='example@example.com', name='John Doe', password_hash='hash'))
    messages = test_domain.event_store.store._read('user')
    assert (len(messages) == 1)
    assert (messages[0]['stream_name'] == f'user-{identifier}')
    assert (messages[0]['type'] == f'{fqn(Registered)}')
@pytest.mark.eventstore
def test_that_events_can_be_raised_from_within_aggregates(test_domain):
    identifier = str(uuid4())
    UserCommandHandler().register_user(Register(id=identifier, email='example@example.com', name='John Doe', password_hash='hash'))
    messages = test_domain.event_store.store._read('user')
    assert (len(messages) == 1)
    assert (messages[0]['stream_name'] == f'user-{identifier}')
    assert (messages[0]['type'] == f'{fqn(Registered)}')