def test_posts_in_context(self): mock_template = mock.Mock() builder = ListPageBuilder(mock_template) builder._posts = ['fake post'] builder._generate_output() context = mock_template.render.call_args[0][0] self.assertEqual(['fake post'], context['posts'])
def test_blog_list_in_context(self): mock_template = mock.Mock() builder = ListPageBuilder(mock_template) builder._blog_list = 'fake li items' builder._generate_output() context = mock_template.render.call_args[0][0] self.assertEqual('fake li items', context['blog_list'])
def test_output_is_rendered(self): mock_template = mock.Mock() mock_template.render.return_value = 'fake HTML' builder = ListPageBuilder(mock_template) output = builder._generate_output() self.assertEqual('fake HTML', output)