Mercurial > public > sg101
view messages/tests/test_forms.py @ 1212:d18db8bfe17a modernize
Add unit tests for forums tasks.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 06 Feb 2025 21:31:05 -0600 |
parents | 82f1f6f905eb |
children |
line wrap: on
line source
"""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 ', } user = User.objects.get(username='eddie') f = ComposeForm(user, data) self.assertFalse(f.is_valid())