#NEWLINE# def test_voter_registration( self ) : #NEWLINE# #INDENT# voters = models . Voter . get_by_election ( self . election ) #NEWLINE# self . assertTrue ( ( len ( voters ) == 0 ) ) #NEWLINE# voter = models . Voter . get_by_election_and_user ( voters . election , self . user ) #NEWLINE# self . assertTrue ( ( voter == None ) ) #NEWLINE# voters = models . Voter . get_by_user ( self . user ) #NEWLINE# self . assertTrue ( ( len ( voters ) == 0 ) ) #NEWLINE# voter = models . Voter . register_user_in_election ( self . user , self . election ) #NEWLINE# voter_2 = models . Voter . get_by_election_and_user ( self . election , self . user ) #NEWLINE# self . assertFalse ( ( voter == None ) ) #NEWLINE# self . assertFalse ( ( voter_2 == None ) ) #NEWLINE# self . assertEquals ( voter , voter_2 ) #NEWLINE# voters = models . Voter . get_by_user ( self . user ) #NEWLINE# self . assertTrue ( ( len ( voters ) == 1 ) ) #NEWLINE# self . assertEquals ( voter , voters [ 0 ] ) #NEWLINE# voter_2 = models . Voter . get_by_election_and_uuid ( self . election , voter . uuid ) #NEWLINE# self . assertEquals ( voter , voter_2 ) #NEWLINE# self . assertEquals ( voter . user , self . user )