Ticket #12027: 12027_patch_test.diff​

File 12027_patch_test.diff​, 1.1 KB (added by shaz, 11 years ago)
Line 
1diff --git a/tests/validation/tests.py b/tests/validation/tests.py
2index b571e0c..3a78ed1 100644
3--- a/tests/validation/tests.py
4+++ b/tests/validation/tests.py
5@@ -1,5 +1,7 @@
6 from __future__ import absolute_import, unicode_literals
7
8+import unittest
9+
10 from django import forms
11 from django.core.exceptions import NON_FIELD_ERRORS
12 from django.test import TestCase
13@@ -47,6 +49,13 @@ class BaseModelValidationTests(ValidationTestCase):
14 mtv = ModelToValidate(number=10, name='Some Name', email='valid@email.com')
15 self.assertEqual(None, mtv.full_clean())
16
17+ @unittest.expectedFailure
18+ def test_trailing_dot_on_email_passes(self):
19+ #regression test for #12027
20+ #EmailValidator regex will needs to be updated for this to fail.
21+ mtv = ModelToValidate(number=10, name="Some Name", email="should@fail.com.")
22+ self.assertFailsValidation(mtv.full_clean, ['email'])
23+
24 def test_wrong_url_value_raises_error(self):
25 mtv = ModelToValidate(number=10, name='Some Name', url='not a url')
26 self.assertFieldFailsValidationWithMessage(mtv.full_clean, 'url', ['Enter a valid URL.'])
Back to Top