X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=tests%2Ftest_motion.py;h=6551a31ed7e516e538b83fec1f8416ecd19e98de;hb=e59274f6a108ec57931014e8fcb1319c63fa1f2d;hp=c1f996c3312966439f5bb4a5572cd5637372d350;hpb=c889a7fbfefd94479ee09b224b3274d05145a1dc;p=motion.git diff --git a/tests/test_motion.py b/tests/test_motion.py index c1f996c..6551a31 100644 --- a/tests/test_motion.py +++ b/tests/test_motion.py @@ -9,7 +9,8 @@ app.config.update( DEBUGUSER = {}, GROUP_PREFIX = {'127.0.0.1:5000': {'group1': 'g1', 'group2': 'g2'}}, DURATION = {'127.0.0.1:5000':[3, 7, 14]}, - SERVER_NAME = '127.0.0.1:5000' + SERVER_NAME = '127.0.0.1:5000', + MAX_PROXY=2 ) app.config['TESTING'] = True @@ -48,6 +49,26 @@ class BasicTest(TestCase): data=dict(reason=reason) ) + def finishMotion(self, user, motion): + return self.app.post( + '/motion/' + motion +'/finish', + environ_base={'USER_ROLES': user} + ) + + def addProxy(self, user, voter, proxy): + return self.app.post( + '/proxy/add', + environ_base={'USER_ROLES': user}, + data=dict(voter=voter, proxy=proxy) + ) + + def revokeProxy(self, user, id): + return self.app.post( + '/proxy/revoke', + environ_base={'USER_ROLES': user}, + data=dict(id=id) + ) + def buildResultText(self, motiontext, yes, no, abstain): return '
'+motiontext+'
\n\nYes '+str(yes)+'
'\
+ '\nNo '+str(no)+'
'\
@@ -120,6 +141,8 @@ class GeneralTests(BasicTest):
+ '\nNo 1
'\
+ '\nAbstain 0
\n
A second motion
\n \n\nBack\n