summaryrefslogtreecommitdiff
path: root/tests/model_forms/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/model_forms/models.py')
-rw-r--r--tests/model_forms/models.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/model_forms/models.py b/tests/model_forms/models.py
index a798f9bf95..a4cf9471de 100644
--- a/tests/model_forms/models.py
+++ b/tests/model_forms/models.py
@@ -11,6 +11,7 @@ from __future__ import unicode_literals
import os
import tempfile
+from django.core import validators
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import FileSystemStorage
from django.db import models
@@ -286,3 +287,12 @@ class ColourfulItem(models.Model):
class ArticleStatusNote(models.Model):
name = models.CharField(max_length=20)
status = models.ManyToManyField(ArticleStatus)
+
+class CustomErrorMessage(models.Model):
+ name1 = models.CharField(max_length=50,
+ validators=[validators.validate_slug],
+ error_messages={'invalid': 'Model custom error message.'})
+
+ name2 = models.CharField(max_length=50,
+ validators=[validators.validate_slug],
+ error_messages={'invalid': 'Model custom error message.'})