bgneal@1022: """Unit tests for the messages application forms.""" bgneal@1022: bgneal@1022: from django.contrib.auth.models import User bgneal@1022: from django.test import TestCase bgneal@1022: bgneal@1022: from messages.forms import ComposeForm bgneal@1022: bgneal@1022: bgneal@1022: class ComposeFormTestCase(TestCase): bgneal@1022: fixtures = ['messages_test_users.json'] bgneal@1022: bgneal@1022: def test_unsafe_image(self): bgneal@1022: data = { bgneal@1022: 'receiver': 'pj', bgneal@1022: 'subject': 'Test subject', bgneal@1022: 'message': 'Hi ![image](http:example.com/a.jpg)', bgneal@1022: } bgneal@1022: user = User.objects.get(username='eddie') bgneal@1022: f = ComposeForm(user, data) bgneal@1022: self.assertFalse(f.is_valid()) bgneal@1022: