annotate messages/tests/test_forms.py @ 1157:e4f2d6a4b401

Rework S3 connection logic for latest versions of Python 2.7. Had to make these changes for Ubuntu 16.04. Seems backward compatible with production.
author Brian Neal <bgneal@gmail.com>
date Thu, 19 Jan 2017 18: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