Mercurial > public > sg101
comparison messages/tests/test_forms.py @ 1022:82f1f6f905eb
Perform image_check on private messages.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 09 Dec 2015 21:16:04 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1021:68c3343f3318 | 1022:82f1f6f905eb |
---|---|
1 """Unit tests for the messages application forms.""" | |
2 | |
3 from django.contrib.auth.models import User | |
4 from django.test import TestCase | |
5 | |
6 from messages.forms import ComposeForm | |
7 | |
8 | |
9 class ComposeFormTestCase(TestCase): | |
10 fixtures = ['messages_test_users.json'] | |
11 | |
12 def test_unsafe_image(self): | |
13 data = { | |
14 'receiver': 'pj', | |
15 'subject': 'Test subject', | |
16 'message': 'Hi ![image](http:example.com/a.jpg)', | |
17 } | |
18 user = User.objects.get(username='eddie') | |
19 f = ComposeForm(user, data) | |
20 self.assertFalse(f.is_valid()) | |
21 |