Skip to content

Commit

Permalink
Some functional tests that actually work, yay.
Browse files Browse the repository at this point in the history
  • Loading branch information
pw@slinktopp committed Aug 24, 2009
1 parent 3ac2450 commit 5177824
Showing 1 changed file with 40 additions and 13 deletions.
53 changes: 40 additions & 13 deletions purplevoter/tests/functional/test_people.py
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

0 comments on commit 5177824

Please sign in to comment.