#NEWLINE# def test_election_voters_eligibility( self ) : #NEWLINE# #INDENT# self . client . get ( '/' ) #NEWLINE# self . setup_login ( ) #NEWLINE# response = self . client . post ( '/helios/elections/new' , { #NEWLINE# #INDENT# 'short_name' : 'test-eligibility' , #NEWLINE# 'name' : 'Test Eligibility' , #NEWLINE# 'description' : 'An election test for voter eligibility' , #NEWLINE# 'election_type' : 'election' , #NEWLINE# 'use_voter_aliases' : '0' , #NEWLINE# 'use_advanced_audit_features' : '1' , #NEWLINE# 'private_p' : 'False' , #NEWLINE# 'csrf_token' : self . client . session [ 'csrf_token' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# election_id = re . match ( '(.*)/elections/(.*)/view' , response [ 'Location' ] ) . group ( 2 ) #NEWLINE# response = self . client . post ( ( '/helios/elections/%s/voters/eligibility' % election_id ) , { #NEWLINE# #INDENT# 'csrf_token' : self . client . session [ 'csrf_token' ] , #NEWLINE# 'eligibility' : 'openreg' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . clear_login ( ) #NEWLINE# response = self . client . get ( ( '/helios/elections/%s/voters/list' % election_id ) ) #NEWLINE# self . assertContains ( response , 'Anyone can vote' ) #NEWLINE# self . setup_login ( ) #NEWLINE# response = self . client . post ( ( '/helios/elections/%s/voters/eligibility' % election_id ) , { #NEWLINE# #INDENT# 'csrf_token' : self . client . session [ 'csrf_token' ] , #NEWLINE# 'eligibility' : 'closedreg' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . clear_login ( ) #NEWLINE# response = self . client . get ( ( '/helios/elections/%s/voters/list' % election_id ) ) #NEWLINE# self . assertContains ( response , 'Only the voters listed here' )