+ motion='g1.30200402.001'
+ reason="cancel-test"
+ response = self.cancelMotion(user, motion, reason)
+ self.assertEqual(response.status_code, 404)
+ self.assertIn(str.encode('Error, Not found'), response.data)
+
+ motion='g1.20200402.004'
+ response = self.cancelMotion(user, motion, reason)
+ self.assertEqual(response.status_code, 403)
+ self.assertIn(str.encode('Error, out of time'), response.data)
+
+ def test_finishMotion(self):
+ self.db_sampledata()
+
+ motion='g1.20200402.004'
+ response = self.finishMotion(user, motion)
+ self.assertEqual(response.status_code, 302)
+ result = self.app.get('/', environ_base={'USER_ROLES': user})
+ self.assertIn(b'Motion D</span> (Finished)', result.data)
+
+ motion='g1.30190402.001'
+ response = self.finishMotion(user, motion)
+ self.assertEqual(response.status_code, 404)
+ self.assertIn(str.encode('Error, Not found'), response.data)
+
+ motion='g1.20200402.001'
+ response = self.finishMotion(user, motion)
+ self.assertEqual(response.status_code, 403)
+ self.assertIn(str.encode('Error, out of time'), response.data)