aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_model_serializer.py
diff options
context:
space:
mode:
authorTom Christie2014-12-19 21:44:24 +0000
committerTom Christie2014-12-19 21:44:24 +0000
commit889a0bdeca942995ab32bf19c3d9fdbfaeec58ec (patch)
tree6b0a43326c6541662862de2b21d290c8c0b86007 /tests/test_model_serializer.py
parent435aef77384759d5a29129cdb0cbe47b3de6df93 (diff)
parent2a1485e00943b8280245d19e1e1f8514b1ef18ea (diff)
downloaddjango-rest-framework-889a0bdeca942995ab32bf19c3d9fdbfaeec58ec.tar.bz2
Merge pull request #2322 from tomchristie/model-serializer-api
ModelSerializer API.
Diffstat (limited to 'tests/test_model_serializer.py')
-rw-r--r--tests/test_model_serializer.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_model_serializer.py b/tests/test_model_serializer.py
index da79164a..603faf47 100644
--- a/tests/test_model_serializer.py
+++ b/tests/test_model_serializer.py
@@ -206,7 +206,7 @@ class TestRegularFieldMappings(TestCase):
with self.assertRaises(ImproperlyConfigured) as excinfo:
TestSerializer().fields
- expected = 'Field name `invalid` is not valid for model `ModelBase`.'
+ expected = 'Field name `invalid` is not valid for model `RegularFieldsModel`.'
assert str(excinfo.exception) == expected
def test_missing_field(self):
@@ -221,11 +221,11 @@ class TestRegularFieldMappings(TestCase):
model = RegularFieldsModel
fields = ('auto_field',)
- with self.assertRaises(ImproperlyConfigured) as excinfo:
+ with self.assertRaises(AssertionError) as excinfo:
TestSerializer().fields
expected = (
- 'Field `missing` has been declared on serializer '
- '`TestSerializer`, but is missing from `Meta.fields`.'
+ "The field 'missing' was declared on serializer TestSerializer, "
+ "but has not been included in the 'fields' option."
)
assert str(excinfo.exception) == expected
@@ -607,5 +607,5 @@ class TestSerializerMetaClass(TestCase):
exception = result.exception
self.assertEqual(
str(exception),
- "Cannot set both 'fields' and 'exclude'."
+ "Cannot set both 'fields' and 'exclude' options on serializer ExampleSerializer."
)