annotate bns_website/videos/tests/view_tests.py @ 79:548b9e61bd64

Updated bands.json to include "asset_prefix" tags for all the bands. Incorporated all the small images from Ferenc into the bands slideshow. Went through and crushed all the large images to fit within 800x600. Make sure to "manage.py loaddata bands.json" after picking this up.
author Chris Ridgway <ckridgway@gmail.com>
date Fri, 25 Nov 2011 16:54:59 -0600
parents a0d3bc630ebd
children
rev   line source
bgneal@60 1 """
bgneal@60 2 View tests for the videos application.
bgneal@60 3
bgneal@60 4 """
bgneal@60 5 from django.test import TestCase
bgneal@60 6 from django.core.urlresolvers import reverse
bgneal@60 7
bgneal@60 8
bgneal@60 9 class NoVideosTest(TestCase):
bgneal@60 10
bgneal@60 11 def test_index(self):
bgneal@60 12 """
bgneal@60 13 Test that the page displays without any videos in the database.
bgneal@60 14
bgneal@60 15 """
bgneal@60 16 response = self.client.get(reverse('videos'))
bgneal@60 17 self.assertEqual(response.status_code, 200)
bgneal@60 18 self.assertEqual(len(response.context['videos']), 0)
bgneal@60 19 self.assertTemplateUsed(response, 'videos/index.html')
bgneal@60 20
bgneal@60 21
bgneal@60 22 class SomeVideosTest(TestCase):
bgneal@60 23 fixtures = ['playlist.json']
bgneal@60 24
bgneal@60 25 def test_index(self):
bgneal@60 26 """
bgneal@60 27 Test that the page displays with videos in the database.
bgneal@60 28
bgneal@60 29 """
bgneal@60 30 response = self.client.get(reverse('videos'))
bgneal@60 31 self.assertEqual(response.status_code, 200)
bgneal@60 32 self.assertEqual(len(response.context['videos']), 50)
bgneal@60 33 self.assertTemplateUsed(response, 'videos/index.html')