Beispiel #1
0
 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')
Beispiel #2
0
 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)
Beispiel #3
0
 def test_video_detail(self):
     video = VideoFactory()
     self.assert_page_loads(video.get_absolute_url(),
         'video/video_detail.html')
Beispiel #4
0
 def setUp(self):
     super(FrontTests, self).setUp()
     self.video = VideoFactory()
Beispiel #5
0
 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)
Beispiel #6
0
    def test_config_present(self):
        VideoFactory()
        resp = self.client.get('/')

        self.assertTrue(resp.context['config'])