fix agenda.test

This commit is contained in:
Oskar Hahn 2012-04-15 16:00:25 +02:00
parent 90038c1ad2
commit d2d3725eb6

View File

@ -18,7 +18,6 @@ from django.db.models.query import EmptyQuerySet
from projector.api import get_active_slide from projector.api import get_active_slide
from agenda.models import Item from agenda.models import Item
from agenda.api import is_summary
class ItemTest(TestCase): class ItemTest(TestCase):
def setUp(self): def setUp(self):
@ -90,28 +89,16 @@ class ViewTest(TestCase):
def testActivate(self): def testActivate(self):
c = self.adminClient c = self.adminClient
response = c.get('/agenda/%d/activate/' % self.item1.id) response = c.get('/projector/activate/%s/' % self.item1.sid)
self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
self.assertTrue(self.item1.active) self.assertTrue(self.item1.active)
self.assertFalse(self.item2.active) self.assertFalse(self.item2.active)
self.assertFalse(is_summary())
response = c.get('/agenda/%d/activate/summary/' % self.item2.id) response = c.get('/projector/activate/%s/' % 'agenda')
self.assertEqual(response.status_code, 302)
self.assertTrue(self.item2.active)
self.assertFalse(self.item1.active)
self.assertTrue(is_summary())
response = c.get('/agenda/%d/activate/' % 0)
self.assertEqual(response.status_code, 302) self.assertEqual(response.status_code, 302)
self.assertFalse(self.item2.active) self.assertFalse(self.item2.active)
self.assertFalse(self.item1.active) self.assertFalse(self.item1.active)
self.assertEqual(get_active_slide(only_sid=True), 'agenda_show') self.assertEqual(get_active_slide(only_sid=True), 'agenda')
response = c.get('/agenda/%d/activate/' % 10000)
self.assertEqual(response.status_code, 404)
self.assertFalse(self.item2.active)
self.assertFalse(self.item1.active)
def testClose(self): def testClose(self):
c = self.adminClient c = self.adminClient