test_metas.py 383 B

1234567891011121314151617
  1. # Copyright © 2023 Ingram Micro Inc. All rights reserved.
  2. import pytest
  3. from dj_cqrs.metas import _MetaUtils
  4. @pytest.mark.django_db
  5. def test_no_cqrs_id():
  6. with pytest.raises(AssertionError) as e:
  7. class Cls(object):
  8. CQRS_ID = None
  9. _MetaUtils.check_cqrs_id(Cls)
  10. assert str(e.value) == 'CQRS_ID must be set for every model, that uses CQRS.'