diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-05-18 07:11:11 -0700 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-05-18 07:11:11 -0700 |
| commit | 7d050e8e9ce0e08aefe035a7e203c764fbfb544b (patch) | |
| tree | 937b58a673d4bf153439d25261661924541d196a /tests | |
| parent | 710c59bf9b09ee5afae2e555c30e13ed59fa4583 (diff) | |
| parent | 186ec21a3dd8c87704c579b6620da931e0f68bb3 (diff) | |
Merge pull request #1113 from denibertovic/master
Fixed #18761 -- Added whitespace stripping to URLField and SlugField.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/forms_tests/tests/test_extra.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/forms_tests/tests/test_extra.py b/tests/forms_tests/tests/test_extra.py index a83cdfc05f..ea0f063c30 100644 --- a/tests/forms_tests/tests/test_extra.py +++ b/tests/forms_tests/tests/test_extra.py @@ -569,6 +569,14 @@ class FormsExtraTestCase(TestCase, AssertFormErrorsMixin): f = GenericIPAddressField(unpack_ipv4=True) self.assertEqual(f.clean(' ::ffff:0a0a:0a0a'), '10.10.10.10') + def test_slugfield_normalization(self): + f = SlugField() + self.assertEqual(f.clean(' aa-bb-cc '), 'aa-bb-cc') + + def test_urlfield_normalization(self): + f = URLField() + self.assertEqual(f.clean('http://example.com/ '), 'http://example.com/') + def test_smart_text(self): class Test: if six.PY3: |
