mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/model-validation@11190 bcc190cf-cafb-0310-a4f2-bffc1f526a37
14 lines
377 B
Python
14 lines
377 B
Python
import unittest
|
|
|
|
from django.core.exceptions import ValidationError
|
|
|
|
class ValidationTestCase(unittest.TestCase):
|
|
def assertFailsValidation(self, clean, failed_fields):
|
|
self.assertRaises(ValidationError, clean)
|
|
try:
|
|
clean()
|
|
except ValidationError, e:
|
|
self.assertEquals(sorted(failed_fields), sorted(e.message_dict.keys()))
|
|
|
|
|