]> WPIA git - motion.git/blobdiff - tests/test_motion.py
Merge remote-tracking branch 'gitlab/master' into unittest-fix
[motion.git] / tests / test_motion.py
index 8634d2ca2b9c2fb92f598daaa411d5f383b791dd..2b95b1e42291438ab506c1a49a16c77236a4faea 100644 (file)
@@ -1,5 +1,5 @@
 from datetime import datetime
-from .test_basics import BasicTest
+from tests.test_basics import BasicTest
 
 # no specific rights required
 class GeneralTests(BasicTest):
@@ -400,6 +400,19 @@ class CreateMotionTests(BasicTest):
         self.assertEqual(response.status_code, 403)
         self.assertIn(str.encode('Forbidden'), response.data)
 
+    def test_SeeCancelMotion(self):
+        self.db_sampledata()
+
+        motion='g1.20200402.004'
+        result = self.app.get('/motion/' + motion, environ_base={'USER_ROLES': user}, follow_redirects=True)
+        testtext= '<button type="submit" class="btn btn-danger" name="cancel" value="cancel" id="cancel">Cancel</button>'
+        self.assertIn(str.encode(testtext), result.data)
+
+        motion='g1.20200402.004'
+        result = self.app.get('/motion/' + motion, environ_base={'USER_ROLES': 'testuser/vote:*'}, follow_redirects=True)
+        testtext= '<button type="submit" class="btn btn-danger" name="cancel" value="cancel" id="cancel">Cancel</button>'
+        self.assertNotIn(str.encode(testtext), result.data)
+
     def test_cancelMotion(self):
         self.db_sampledata()
 
@@ -432,6 +445,19 @@ class CreateMotionTests(BasicTest):
         self.assertEqual(response.status_code, 403)
         self.assertIn(str.encode('Error, motion was canceled'), response.data)
 
+    def test_SeeFinishMotion(self):
+        self.db_sampledata()
+
+        motion='g1.20200402.004'
+        result = self.app.get('/motion/' + motion, environ_base={'USER_ROLES': user}, follow_redirects=True)
+        testtext= '<button type="submit" class="btn btn-danger" name="finish" value="finish" id="finish">Finish</button>'
+        self.assertIn(str.encode(testtext), result.data)
+
+        motion='g1.20200402.004'
+        result = self.app.get('/motion/' + motion, environ_base={'USER_ROLES': 'testuser/vote:*'}, follow_redirects=True)
+        testtext= '<button type="submit" class="btn btn-danger" name="finish" value="finish" id="finish">Finish</button>'
+        self.assertNotIn(str.encode(testtext), result.data)
+
     def test_finishMotion(self):
         self.db_sampledata()