Ejemplo n.º 1
0
def test_no_cqrs_queue(settings):
    settings.CQRS.update({'queue': None})

    with pytest.raises(AssertionError) as e:
        ReplicaRegistry.register_model(replica_models.MappedFieldsModelRef)

    assert str(
        e.value
    ) == 'CQRS queue must be set for the service, that has replica models.'
Ejemplo n.º 2
0
    def __new__(mcs, *args):
        model_cls = super(ReplicaMeta, mcs).__new__(mcs, *args)

        if args[0] != 'ReplicaMixin':
            _MetaUtils.check_cqrs_id(model_cls)
            ReplicaMeta._check_cqrs_mapping(model_cls)
            ReplicaRegistry.register_model(model_cls)

        return model_cls