aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/serializers.py3
-rw-r--r--rest_framework/tests/serializer.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index 669e5ae9..d57417d9 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -425,7 +425,8 @@ class ModelSerializer(Serializer):
cls = self.opts.model
if cls is None:
- raise AttributeError("Serializer class is missing 'model' Meta option")
+ raise AttributeError("Serializer class '%s' is missing 'model' Meta option" %
+ self.__class__.__name__)
opts = get_concrete_model(cls)._meta
pk_field = opts.pk
# while pk_field.rel:
diff --git a/rest_framework/tests/serializer.py b/rest_framework/tests/serializer.py
index af84c46b..d4e9cc13 100644
--- a/rest_framework/tests/serializer.py
+++ b/rest_framework/tests/serializer.py
@@ -366,7 +366,7 @@ class ValidationTests(TestCase):
try:
serializer = BrokenModelSerializer()
except AttributeError as e:
- self.assertEquals(e.args[0], "Serializer class is missing 'model' Meta option")
+ self.assertEquals(e.args[0], "Serializer class 'BrokenModelSerializer' is missing 'model' Meta option")
except:
self.fail('Wrong exception type thrown.')