Пример #1
0
 def test_send_data(self):
     form = SimpleRequestForm(self.data)
     self.assertTrue(form.is_bound)
     self.assertTrue(form.is_valid(), form.errors)
     msg = form.save(commit=True)
     self.assertIsNotNone(msg)
     self.assertIsNotNone(msg.pk)
     self.assertEqual(1, msg.status)
     self.assertEqual(1, msg.messageType)
     msg.delete()
Пример #2
0
 def test_message_with_cats(self):
     form = SimpleRequestForm(self.data)
     self.assertTrue(form.is_valid())
     msg = form.save()
     self.assertEqual(5, msg.category.all().count())