-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some functional tests that actually work, yay.
- Loading branch information
pw@slinktopp
committed
Aug 24, 2009
1 parent
3ac2450
commit 5177824
Showing
1 changed file
with
40 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,48 @@ | ||
from purplevoter.tests import * | ||
from purplevoter.tests import url, TestController | ||
|
||
class TestPeopleController(TestController): | ||
|
||
def test_geocoder(self): | ||
response = self.app.get(url(controller='people', action='search', address='669 degraw st, 11217')) | ||
# senate | ||
assert 'Charles Schumer' in response | ||
assert 'Kirsten Gillibrand' in response | ||
degraw = '669 degraw st., 11217' | ||
|
||
# fed rep - D 11 | ||
assert 'Yvette D. Clarke' in response | ||
# def test_geocoder_senate(self): | ||
# response = self.app.get(url(controller='people', action='search', address=self.degraw)) | ||
|
||
# city council | ||
# assert 'Charles Schumer' in response | ||
# assert 'Kirsten Gillibrand' in response | ||
|
||
# def test_geocoder_us_house(self): | ||
# response = self.app.get(url(controller='people', action='search', address=self.degraw)) | ||
# # fed rep - D 11 | ||
# assert 'Yvette D. Clarke' in response | ||
|
||
# def test_geocoder_state_assembly(self): | ||
# response = self.app.get(url(controller='people', action='search', address=self.degraw)) | ||
# # state assembly - D 52 | ||
# assert 'Joan Millman' in response | ||
|
||
# def test_geocoder_state_senate(self): | ||
# response = self.app.get(url(controller='people', action='search', address=self.degraw)) | ||
# # state senate - D 18 | ||
# assert 'Velmanette Montgomery' in response | ||
|
||
def test_geocoder_council(self): | ||
response = self.app.get(url(controller='people', action='search', address=self.degraw)) | ||
assert 'David Yassky' in response | ||
|
||
# state assembly - D 52 | ||
assert 'Joan Millman' in response | ||
def test_no_address(self): | ||
response = self.app.get(url(controller='people', action='search')) | ||
assert 'No results found' in response | ||
|
||
def test_bogus_address(self): | ||
response = self.app.get(url(controller='people', action='search', address='Zbasp89ba~#$')) | ||
assert 'No results found' in response | ||
|
||
|
||
def test_address_out_of_known_world(self): | ||
response = self.app.get(url(controller='people', action='search', address='90210')) | ||
assert 'No results found' in response | ||
|
||
def test_address_ambiguous(self): | ||
response = self.app.get(url(controller='people', action='search', address='main st.')) | ||
assert 'Did you mean one of these addresses?' in response | ||
|
||
# state senate - D 18 | ||
assert 'Velmanette Montgomery' in response |