def test_message_status(self): form = UserMessageForm(data=self.data) msg = form.save(commit=False) self.assertEqual(msg.status, Message.NEW)
def test_store_message(self): form = UserMessageForm(data=self.data) msg = form.save(commit=False) msg.user = UserFactory() msg.save() self.assertEqual(1, Message.objects.count())
def test_contact_data(self): """ Тестирование сохранения контактных данных """ form = UserMessageForm(data=self.data) msg = form.save(commit=False) self.assertIsNotNone(msg.additional_info) self.assertEqual(msg.additional_info, self.contacts)
def test_create_message(self): form = UserMessageForm(data=self.data) msg = form.save(commit=False) self.assertIsNotNone(msg)