summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/tests/utils.py
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-10-13 14:49:06 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-10-13 14:49:06 +0800
commit6ea54166123c6f839af02bd8efb16b33e78acd3c (patch)
tree921f2a935e48670bb6602202ecbf935cba151f2e /apps/patchwork/tests/utils.py
parenta37842591183a2302f580ee4973a19e35661baf0 (diff)
downloadpatchwork-6ea54166123c6f839af02bd8efb16b33e78acd3c.tar.bz2
patchwork-6ea54166123c6f839af02bd8efb16b33e78acd3c.tar.xz
tests: Use strings from fields module for error tests
Rather than hard-coding expected error messages, grab the values from the fields module, and expose through the test utils. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/tests/utils.py')
-rw-r--r--apps/patchwork/tests/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/patchwork/tests/utils.py b/apps/patchwork/tests/utils.py
index f340f09..d4708aa 100644
--- a/apps/patchwork/tests/utils.py
+++ b/apps/patchwork/tests/utils.py
@@ -21,6 +21,7 @@ import os
import codecs
from patchwork.models import Project, Person
from django.contrib.auth.models import User
+from django.forms.fields import EmailField
from email import message_from_file
try:
@@ -56,6 +57,10 @@ class defaults(object):
+a
"""
+error_strings = {
+ 'email': EmailField.default_error_messages['invalid'],
+}
+
_user_idx = 1
def create_user():
global _user_idx