File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
from unittest import TestCase
2
2
3
- from elex4 .lib .models import Candidate
3
+ from elex4 .lib .models import Candidate , Race
4
+
4
5
5
6
class TestCandidate (TestCase ):
6
7
@@ -42,3 +43,16 @@ def test_county_results_access(self):
42
43
self .cand .add_votes ("Some County" , 20 )
43
44
expected = { "Some County" : 20 }
44
45
self .assertEquals (self .cand .county_results , expected )
46
+
47
+
48
+ class TestRace (TestCase ):
49
+
50
+ def test_clean_office_rep (self ):
51
+ race = Race ("2012-11-06" , "U.S. Rep - 1" )
52
+ self .assertEquals (race .office , "U.S. House of Representatives" )
53
+ self .assertEquals (race .district , 1 )
54
+
55
+ def test_clean_office_other (self ):
56
+ race = Race ("2012-11-06" , "President" )
57
+ self .assertEquals (race .office , "President" )
58
+ self .assertEquals (race .district , None )
You can’t perform that action at this time.
0 commit comments