浏览代码

Adding test class for Yelp, removing method from meetup.py

David Leonard 10 年之前
父节点
当前提交
943656afda
共有 2 个文件被更改,包括 5 次插入11 次删除
  1. 0 11
      hackathon_starter/hackathon/scripts/meetup.py
  2. 5 0
      hackathon_starter/hackathon/tests.py

+ 0 - 11
hackathon_starter/hackathon/scripts/meetup.py

@@ -20,15 +20,4 @@ def retrieveUserData(url):
     filteredData.append(data)
     filteredData.append(data)
     return filteredData
     return filteredData
 
 
-def retrieveDashboard(url):
-    req = requests.get(url)
-    content = json.loads(req.content)
-    filteredData = []
-    data = {}
-    data['last_event'] = content['last_event']['venue']
-    data['group'] = content['last_event']['group']['name']
-    data['name'] = content['last_event']['name']
-    filteredData.append(data)
-    return filteredData
-
 
 

+ 5 - 0
hackathon_starter/hackathon/tests.py

@@ -76,6 +76,7 @@ class HackathonViewsTestCase(TestCase):
 		resp = self.client.get('/hackathon/nytimespop/')
 		resp = self.client.get('/hackathon/nytimespop/')
 		self.assertEqual(resp.status_code, 200)
 		self.assertEqual(resp.status_code, 200)
 
 
+class YelpTestCase(TestCase):
 	def testYelpPost(self):
 	def testYelpPost(self):
 		resp = self.client.post('/hackathon/yelp/', {'location': 'yelp-san-francisco'})
 		resp = self.client.post('/hackathon/yelp/', {'location': 'yelp-san-francisco'})
 		self.assertEqual(resp.status_code, 200)
 		self.assertEqual(resp.status_code, 200)
@@ -88,4 +89,8 @@ class HackathonViewsTestCase(TestCase):
 		resp = self.client.post('/hackathon/yelp/', {'location': 'yelp-san-francisco'})
 		resp = self.client.post('/hackathon/yelp/', {'location': 'yelp-san-francisco'})
 		self.assertIsNotNone(resp.content)
 		self.assertIsNotNone(resp.content)
 
 
+	def testGetYelpPage(self):
+		resp = self.client.get('/hackathon/yelp')
+		self.assertEqual(resp.status_code, 301)
+