コード例 #1
0
 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'])
コード例 #2
0
 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'])
コード例 #3
0
 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'])
コード例 #4
0
 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'])
コード例 #5
0
 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)
コード例 #6
0
 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)