def test_video_index(self): VideoFactory() VideoFactory(name="Test Video 2", slug="video-2") self.assert_page_loads(reverse('video-index'), 'video/video_index.html')
def test_video_detail_is_not_published(self): video = VideoFactory(is_published=False) resp = self.client.get(video.get_absolute_url()) self.assertEqual(resp.status_code, 404)
def test_video_detail(self): video = VideoFactory() self.assert_page_loads(video.get_absolute_url(), 'video/video_detail.html')
def setUp(self): super(FrontTests, self).setUp() self.video = VideoFactory()
def test_front_video_is_latest(self): self.video = VideoFactory(pub_date=datetime.datetime.now()) resp = self.client.get('/') self.assertEqual(resp.context['latest_video'], self.video)
def test_config_present(self): VideoFactory() resp = self.client.get('/') self.assertTrue(resp.context['config'])