def test_basic_results_data_details(self):
motion='g1.20200402.002'
result = self.app.get('/motion/' + motion, environ_base={'USER_ROLES': user}, follow_redirects=True)
- testtext= '<p>A second motion</p></p>\n </div>\n</div>\n<a href=\"/?start=2#motion-2\" class=\"btn btn-primary\">Back</a>\n</body>'
+ testtext= '<p>A second motion</p></p>\n </div>\n</div>\n<a href=\"/?start=2#motion-2\" class=\"btn btn-primary\">Back</a>'
self.assertIn(str.encode(testtext), result.data)
def test_vote(self):
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'