annotate messages/tests/test_forms.py @ 1189:83dd2db291f7

Added tool to tag MP3 comp files.
author Brian Neal <bgneal@gmail.com>
date Mon, 27 Dec 2021 19:35:53 -0600
parents 82f1f6f905eb
children
rev   line source
bgneal@1022 1 """Unit tests for the messages application forms."""
bgneal@1022 2
bgneal@1022 3 from django.contrib.auth.models import User
bgneal@1022 4 from django.test import TestCase
bgneal@1022 5
bgneal@1022 6 from messages.forms import ComposeForm
bgneal@1022 7
bgneal@1022 8
bgneal@1022 9 class ComposeFormTestCase(TestCase):
bgneal@1022 10 fixtures = ['messages_test_users.json']
bgneal@1022 11
bgneal@1022 12 def test_unsafe_image(self):
bgneal@1022 13 data = {
bgneal@1022 14 'receiver': 'pj',
bgneal@1022 15 'subject': 'Test subject',
bgneal@1022 16 'message': 'Hi ![image](http:example.com/a.jpg)',
bgneal@1022 17 }
bgneal@1022 18 user = User.objects.get(username='eddie')
bgneal@1022 19 f = ComposeForm(user, data)
bgneal@1022 20 self.assertFalse(f.is_valid())
bgneal@1022 21