瀏覽代碼

Adding tests for New York Times endpoints

David Leonard 10 年之前
父節點
當前提交
048ea9b6b2
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      hackathon_starter/hackathon/tests.py

+ 8 - 0
hackathon_starter/hackathon/tests.py

@@ -124,4 +124,12 @@ class NewYorkTimesTestCase(TestCase):
 		resp = self.client.get('/hackathon/nytimestop/')
 		self.assertNotEqual(resp.content, '')
 
+	def testNewYorkTimesArticles(self):
+		resp = self.client.get('/hackathon/nytimesarticles/')
+		self.assertEqual(resp.status_code, 200)
+
+	def testNewYorkTimesArticlesContent(self):
+		resp = self.client.get('/hackathon/nytimesarticles/')
+		self.assertEqualNotEqual(resp.content, '')
+