X-Git-Url: https://code.wpia.club/?p=motion.git;a=blobdiff_plain;f=tests%2Ftest_motion.py;fp=tests%2Ftest_motion.py;h=86d69feffb85225be2f60882af14034efd9da82d;hp=b6622a2c006cf6aca5d7b7401568499b3abb9439;hb=a96ee100bf39a3c04a500707084222fec45a8b06;hpb=aa66d52ad5b00a2ee8da2accbcd58bde428d502b diff --git a/tests/test_motion.py b/tests/test_motion.py index b6622a2..86d69fe 100644 --- a/tests/test_motion.py +++ b/tests/test_motion.py @@ -416,9 +416,25 @@ class CreateMotionTests(BasicTest): title='My Motion' content='My body' response = self.createMotion(user, title, content, '21', 'group1') - self.assertEqual(response.status_code, 500) + self.assertEqual(response.status_code, 400) self.assertIn(str.encode('Error, invalid length'), response.data) + def test_createMotionMissingData(self): + title='' + content='' + response = self.createMotion(user, title, content, '3', 'group1') + self.assertEqual(response.status_code, 400) + self.assertIn(str.encode('Error, missing title'), response.data) + title='New Motion' + response = self.createMotion(user, title, content, '3', 'group1') + self.assertEqual(response.status_code, 400) + self.assertIn(str.encode('Error, missing content'), response.data) + title='' + content='New Content' + response = self.createMotion(user, title, content, '3', 'group1') + self.assertEqual(response.status_code, 400) + self.assertIn(str.encode('Error, missing title'), response.data) + def test_createMotionWrongGroup(self): title='My Motion' content='My body'