src/cm/tests/test_notifications.py
author reno
Thu, 03 Dec 2009 15:55:39 +0100
changeset 17 a4be0b8a905d
parent 0 40c8f766c9b8
child 27 29b90002451c
permissions -rw-r--r--
bug fix : can view own comment on comment add on mod priori bug fix : client : add no-notif record when user declines it

from django.core import mail
from django.test import TestCase
from django.test.client import Client
from django.core import management

from cm.models import *
from cm.models_utils import *

class NotificationTest(TestCase):
    fixtures = ['roles_generic','test_content']
    
    def test_global_notification(self):
        c = Client()
        c.login(username='user1', password='test')
        print Notification.objects.all()

        c.post('/notifications/', {'notify_check': u'true'})

        # ? error ? django tests system bug?
        c.post('/client/', {'content' : 'sdf',
                            'end_offset' : 11,
                            'end_wrapper' : 0,
                            'format' : 'markdown',
                            'fun' : 'addComment',
                            'key' : 'text_key_1',
                            'start_offset' : 8,
                            'start_wrapper' : 0,
                            'title' : 'sdf',
                            })
        self.assertEquals(len(mail.outbox), 1)