def test_topic_api_list(self): '''It should fetch a topic list from the API''' topics = TopicFactory.create_batch(3) response = self.get(url_for('api.topics')) self.assert200(response) self.assertEqual(len(response.json['data']), len(topics))
def test_topics_within_sitemap(self): '''It should return a topic list from the sitemap.''' topics = TopicFactory.create_batch(3) self.get_sitemap_tree() for topic in topics: url = self.get_by_url('topics.display_redirect', topic=topic) self.assertIsNotNone(url) self.assert_url(url, 0.8, 'weekly')
def test_topics_within_sitemap(self, sitemap): '''It should return a topic list from the sitemap.''' topics = TopicFactory.create_batch(3) sitemap.fetch() for topic in topics: url = sitemap.get_by_url('topics.display_redirect', topic=topic) assert url is not None # assert url is not None sitemap.assert_url(url, 0.8, 'weekly')