Index: tests/regressiontests/forms/models.py
===================================================================
--- tests/regressiontests/forms/models.py	(revision 12899)
+++ tests/regressiontests/forms/models.py	(working copy)
@@ -74,7 +74,63 @@
         # only one query is required to pull the model from DB
         self.assertEqual(initial_queries+1, len(connection.queries))
 
+# Regression test for #13184
+# Raising ValidationError in the custom model field
+# with __metaclass__ = models.SubfieldBase should not cause the ValidationError
+# to propagate beyond the methods, that perform the validation.
+# The whole "custom type" path can be omitted, but, perhaps,
+# it is better to include a clear example of a use case here
+from django.core.exceptions import ValidationError
 
+class CustomType(object):
+    def __init__(self, text):
+        if text != 'foo':
+            raise ValidationError('The value must be "foo", received "%s"' % text)
+        self.data = text
+
+class TestFieldSubfieldBase(models.Field):
+    __metaclass__ = models.SubfieldBase
+    
+    def to_python(self, value):
+        if isinstance(value, CustomType):
+            return value
+        if value is None or value == '':
+            return None
+        return CustomType(value)
+
+class ModelWithCustomFields(models.Model):
+    field_with_subfieldbase = TestFieldSubfieldBase()
+
+class Ticket13184Form(django_forms.ModelForm):
+    class Meta:
+        model = ModelWithCustomFields
+    
+class TestTicket13184(TestCase):
+
+    def test_valid_value_with_subfieldbase(self):
+        form = Ticket13184Form(data={u'field_with_subfieldbase':u'foo'})
+        self.assertTrue(form.is_valid())
+    
+    def test_invalid_value_with_subfieldbase(self):
+        form = Ticket13184Form(data={u'field_with_subfieldbase':u'bar'})
+        self.assertFalse(form.is_valid())
+    
+    def test_errors_with_invalid_field_value(self):
+        ''' Only the original ValidationError should appear in the errors dict '''
+        form = Ticket13184Form(data={u'field_with_subfieldbase':u'bar'})
+        self.assertEqual(form.errors[u'field_with_subfieldbase'],
+                         [u'The value must be "foo", received "bar"'])
+
+    def test_errors_with_empty_field_value(self):
+        '''to_python doesn't raise a ValidationError,
+        a default "required" message should be seen
+        
+        '''
+        form = Ticket13184Form(data={u'field_with_subfieldbase':u''})
+        self.assertEqual(form.errors[u'field_with_subfieldbase'],
+                         [u'This field is required.'])
+
+
 __test__ = {'API_TESTS': """
 >>> from django.forms.models import ModelForm
 >>> from django.core.files.uploadedfile import SimpleUploadedFile
