src/cm/tests/test_notifications.py
changeset 0 40c8f766c9b8
child 27 29b90002451c
equal deleted inserted replaced
-1:000000000000 0:40c8f766c9b8
       
     1 from django.core import mail
       
     2 from django.test import TestCase
       
     3 from django.test.client import Client
       
     4 from django.core import management
       
     5 
       
     6 from cm.models import *
       
     7 from cm.models_utils import *
       
     8 
       
     9 class NotificationTest(TestCase):
       
    10     fixtures = ['roles_generic','test_content']
       
    11     
       
    12     def test_global_notification(self):
       
    13         c = Client()
       
    14         c.login(username='user1', password='test')
       
    15         print Notification.objects.all()
       
    16 
       
    17         c.post('/notifications/', {'notify_check': u'true'})
       
    18 
       
    19         # ? error ? django tests system bug?
       
    20         c.post('/client/', {'content' : 'sdf',
       
    21                             'end_offset' : 11,
       
    22                             'end_wrapper' : 0,
       
    23                             'format' : 'markdown',
       
    24                             'fun' : 'addComment',
       
    25                             'key' : 'text_key_1',
       
    26                             'start_offset' : 8,
       
    27                             'start_wrapper' : 0,
       
    28                             'title' : 'sdf',
       
    29                             })
       
    30         self.assertEquals(len(mail.outbox), 1)        
       
    31