Skip to content

Commit b53eeea

Browse files
committed
Test when mapping is neither a string nor callable
1 parent 5f8cb1a commit b53eeea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_fields.py

+13
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ def test_cell_with_mapping_callable(self, style: XLSXStyle, worksheet: Worksheet
8585
assert isinstance(cell, Cell)
8686
assert cell.value == "bar"
8787

88+
def test_cell_with_invalid_mapping(self, style: XLSXStyle, worksheet: Worksheet):
89+
f = XLSXField(
90+
key="foo",
91+
value="bar",
92+
field=CharField(),
93+
style=style,
94+
mapping=55,
95+
cell_style=style,
96+
)
97+
cell = f.cell(worksheet, 1, 1)
98+
assert isinstance(cell, Cell)
99+
assert cell.value == "bar"
100+
88101

89102
class TestXLSXNumberField:
90103
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)