aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTom Christie2014-12-13 15:04:39 +0000
committerTom Christie2014-12-13 15:04:39 +0000
commit4fb757146af8e805e30cfe4a8914c9fb7251b3fc (patch)
tree057fe1feb52a3c63c37e1710fb024661e1ac63e0 /tests
parentaa571abb2089aedb5902a8f1670e59b4df99f3e9 (diff)
downloaddjango-rest-framework-4fb757146af8e805e30cfe4a8914c9fb7251b3fc.tar.bz2
Fix test for python2/3 compat
Diffstat (limited to 'tests')
-rw-r--r--tests/test_serializer.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_serializer.py b/tests/test_serializer.py
index 9d47b0aa..56b39095 100644
--- a/tests/test_serializer.py
+++ b/tests/test_serializer.py
@@ -191,8 +191,9 @@ class TestIncorrectlyConfigured:
serializer = ExampleSerializer(instance)
with pytest.raises(AttributeError) as exc_info:
serializer.data
- assert str(exc_info.value) == (
+ msg = str(exc_info.value)
+ assert msg.startswith(
"Got AttributeError when attempting to get a value for field `incorrect_name` on serializer `ExampleSerializer`.\n"
"The serializer field might be named incorrectly and not match any attribute or key on the `ExampleObject` instance.\n"
- "Original exception text was: ExampleObject instance has no attribute 'incorrect_name'."
+ "Original exception text was:"
)