Mercurial > public > sg101
comparison bio/tests/test_forms.py @ 1011:164a39d985ef
Perform SSL image_check on profile text fields.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 27 Nov 2015 15:45:05 -0600 |
parents | 8789299c75b1 |
children |
comparison
equal
deleted
inserted
replaced
1010:9afe0610aae5 | 1011:164a39d985ef |
---|---|
24 def test_blank_timezone(self): | 24 def test_blank_timezone(self): |
25 | 25 |
26 form = EditUserProfileForm({}) | 26 form = EditUserProfileForm({}) |
27 self.assertTrue(form.is_valid()) | 27 self.assertTrue(form.is_valid()) |
28 | 28 |
29 def test_profile_text_good(self): | |
30 post_data = {'profile_text': "This is my profile, no images."} | |
31 form = EditUserProfileForm(post_data) | |
32 self.assertTrue(form.is_valid()) | |
33 | |
34 def test_profile_text_bad_image(self): | |
35 post_data = { | |
36 'profile_text': "I'm cool. ![image](http://example.com/test.jpg)", | |
37 } | |
38 form = EditUserProfileForm(post_data) | |
39 self.assertFalse(form.is_valid()) | |
40 | |
41 def test_signature_good(self): | |
42 post_data = {'signature': "This is my signature, no images."} | |
43 form = EditUserProfileForm(post_data) | |
44 self.assertTrue(form.is_valid()) | |
45 | |
46 def test_signature_bad_image(self): | |
47 post_data = { | |
48 'signature': "I'm cool. ![image](http://example.com/test.jpg)", | |
49 } | |
50 form = EditUserProfileForm(post_data) | |
51 self.assertFalse(form.is_valid()) |