  
      def test_slug_related_lookup_invalid_type(self):
          with pytest.raises(ValidationError) as excinfo:
              self.field.to_internal_value(BadType())
          msg = excinfo.value.message
          assert msg == 'Invalid value.'
  
      def test_representation(self):
          representation = self.field.to_representation(self.instance)
          assert representation == self.instance.name
 
</s> remove         msg = excinfo.value.message
 </s> add         msg = excinfo.value.messages[0] </s> remove         msg = excinfo.value.message
 </s> add         msg = excinfo.value.messages[0] </s> remove         msg = excinfo.value.message
 </s> add         msg = excinfo.value.messages[0]
        msg = excinfo.value.messages[0]
  
      def test_slug_related_lookup_invalid_type(self):
          with pytest.raises(ValidationError) as excinfo:
              self.field.to_internal_value(BadType())
        msg = excinfo.value.messages[0]
          assert msg == 'Invalid value.'
  
      def test_representation(self):
          representation = self.field.to_representation(self.instance)
          assert representation == self.instance.name
keep keep keep keep replace keep keep keep keep keep
 Access validation messages in a way thats compatible with 1.4, 1.5 
tests/test_relations.py