Explorar o código

Writing tests for yelp

David Leonard %!s(int64=10) %!d(string=hai) anos
pai
achega
c89f592efd
Modificáronse 1 ficheiros con 10 adicións e 1 borrados
  1. 10 1
      hackathon_starter/hackathon/tests.py

+ 10 - 1
hackathon_starter/hackathon/tests.py

@@ -1,4 +1,5 @@
 from django.test import TestCase
+from django.test import Client
 
 class SteamViewTestCase(TestCase):
 	def testSteam(self):
@@ -73,4 +74,12 @@ class HackathonViewsTestCase(TestCase):
 	
 	def testNytimespop(self):
 		resp = self.client.get('/hackathon/nytimespop/')
-		self.assertEqual(resp.status_code, 200)
+		self.assertEqual(resp.status_code, 200)
+
+	def testYelpPost(self):
+		resp = self.client.post('/hackathon/yelp/', {'location': 'yelp-san-francisco'})
+		self.assertEqual(resp.status_code, 200)
+
+	def testYelpContent(self):
+		resp = self.client.post('/hackathon/yelp/', {'location': 'yelp-san-francisco'})
+		self.assertNotEqual(resp.content, '')