import pytest

from unwind import models


@pytest.mark.parametrize("mapper", models.mapper_registry.mappers)
def test_fields(mapper):
    """Test that models.fields() matches exactly all table columns."""
    dcfields = {f.name for f in models.fields(mapper.class_)}
    mfields = {c.name for c in mapper.columns}
    assert dcfields == mfields
