def test_item_summary(self, mock_render_to_string): agenda_slide(type='summary', pk=1) self.assertTrue(mock_render_to_string.called) self.assertEqual(mock_render_to_string.call_args[0][0], 'agenda/item_slide_summary.html') self.assertEqual(mock_render_to_string.call_args[0][1]['title'], self.item1.get_title()) query = mock_render_to_string.call_args[0][1]['items'] self.assertEqual(repr(query), repr(Item.objects.filter(pk__in=[3, 4])))
def test_normal_slide(self, mock_render_to_string): agenda_slide(pk=1) self.assertTrue(mock_render_to_string.called) self.assertEqual(mock_render_to_string.call_args[0][0], 'agenda/item_slide.html') item = mock_render_to_string.call_args[0][1]['item'] self.assertEqual(item, Item.objects.get(pk=1))
def test_full_agenda_summary(self, mock_render_to_string): agenda_slide() self.assertTrue(mock_render_to_string.called) self.assertEqual(mock_render_to_string.call_args[0][0], 'agenda/item_slide_summary.html') query = mock_render_to_string.call_args[0][1]['items'] self.assertEqual(repr(query), repr(Item.objects.filter(pk__in=[1, 2])))