コード例 #1
0
 def test_candidate_name(self):
     "Candidates should have first_name and last_name attributes"
     cand = Candidate("Smith, Joe", "GOP")
     self.assertEquals(cand.first_name, "Joe")
     self.assertEquals(cand.last_name, "Smith")
コード例 #2
0
 def setUp(self):
     self.cand = Candidate("Smith, Joe", "GOP")
コード例 #3
0
 def test_clean_party_dem(self):
     cand = Candidate("Smith, Joe", "Democratic")
     self.assertEquals(cand.party, 'DEM')
コード例 #4
0
 def test_clean_party_others(self):
     cand = Candidate("Smith, Joe", "Green")
     self.assertEquals(cand.party, 'GREEN')
コード例 #5
0
 def test_party_gop(self):
     cand = Candidate("Smith, Joe", "GOP")
     self.assertEquals(cand.party, 'REP')