Mercurial > public > sg101
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messages/tests/test_forms.py Wed Dec 09 21:16:04 2015 -0600 @@ -0,0 +1,21 @@ +"""Unit tests for the messages application forms.""" + +from django.contrib.auth.models import User +from django.test import TestCase + +from messages.forms import ComposeForm + + +class ComposeFormTestCase(TestCase): + fixtures = ['messages_test_users.json'] + + def test_unsafe_image(self): + data = { + 'receiver': 'pj', + 'subject': 'Test subject', + 'message': 'Hi ![image](http:example.com/a.jpg)', + } + user = User.objects.get(username='eddie') + f = ComposeForm(user, data) + self.assertFalse(f.is_valid()) +