Browse Source

Adding new test, removing census.py

David Leonard 10 years ago
parent
commit
3695d1fdd4

+ 0 - 20
hackathon_starter/hackathon/scripts/census.py

@@ -1,20 +0,0 @@
-'''
-Module containing a handful of methods for 
-aggregating U.S. Census data. 
-'''
-
-import requests
-import simplejson as json
-
-########################
-# CENSUS API CONSTANTS #
-########################
-
-API_BASE_URL = 'http://api.census.gov/data/2013/pep/natstprc'
-
-def getPopulationEstimate(url):
-	req = requests.get(url)
-	#print len(req.text)
-	print req.text
-
-getPopulationEstimate('http://api.census.gov/data/2013/pep/monthlynatchar5?get=AGE,SEX,DATE,RACE5,HISP&key=1286203d2772de1f09f13392cc42a0197b2cd414')

+ 7 - 1
hackathon_starter/hackathon/tests.py

@@ -82,4 +82,10 @@ class HackathonViewsTestCase(TestCase):
 
 	def testYelpContent(self):
 		resp = self.client.post('/hackathon/yelp/', {'location': 'yelp-san-francisco'})
-		self.assertNotEqual(resp.content, '')
+		self.assertNotEqual(resp.content, '')
+
+	def testYelpContentNotNone(self):
+		resp = self.client.post('/hackathon/yelp/', {'location': 'yelp-san-francisco'})
+		self.assertIsNotNone(resp.content)
+
+