Skip to content

Commit 4fb7571

Browse files
committed
Fix test for python2/3 compat
1 parent aa571ab commit 4fb7571

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_serializer.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@ def __init__(self):
191191
serializer = ExampleSerializer(instance)
192192
with pytest.raises(AttributeError) as exc_info:
193193
serializer.data
194-
assert str(exc_info.value) == (
194+
msg = str(exc_info.value)
195+
assert msg.startswith(
195196
"Got AttributeError when attempting to get a value for field `incorrect_name` on serializer `ExampleSerializer`.\n"
196197
"The serializer field might be named incorrectly and not match any attribute or key on the `ExampleObject` instance.\n"
197-
"Original exception text was: ExampleObject instance has no attribute 'incorrect_name'."
198+
"Original exception text was:"
198199
)

0 commit comments

Comments
 (0)