def test_chapters_and_meta(self, mock_requests): resp = resource_language_json(mock_requests, kind="obs", lang="en") self.assertEqual(resp.status_code, 200) data = json.loads(resp.content) self.assertTrue("meta" in data) self.assertEqual(data["meta"], {}) self.assertTrue("chapters" in data) self.assertEqual(data["chapters"], [])
def test_language_404(self, mock_requests): with self.assertRaises(Http404): resource_language_json(mock_requests, kind="obs", lang="bar")
def test_official_resource_type_404(self, mock_requests): with self.assertRaises(Http404): resource_language_json(mock_requests, kind="foo", lang="en")