src/cm/tests/test_notifications.py
changeset 68 db564b6ad6b5
parent 27 29b90002451c
child 278 3d25afbd78ff
equal deleted inserted replaced
65:0d3298833461 68:db564b6ad6b5
    16         c = Client()
    16         c = Client()
    17         c.login(username='user1', password='test')
    17         c.login(username='user1', password='test')
    18         self.assertEquals(len(Notification.objects.all()), 0)
    18         self.assertEquals(len(Notification.objects.all()), 0)
    19 
    19 
    20         # subscribe to workspace notifications
    20         # subscribe to workspace notifications
    21         response = c.post('/notifications/', {'notif_id': u'workspace_notify_check', 
    21         response = c.post('/followup/', {'notif_id': u'workspace_notify_check', 
    22                                               'workspace_notify_check': u'workspace_notify_check',
    22                                          'workspace_notify_check': u'workspace_notify_check',
    23                                               })
    23                                          })
    24 
    24 
    25         self.assertEquals(len(Notification.objects.all()), 1)
    25         self.assertEquals(len(Notification.objects.all()), 1)
    26         
    26         
    27         # subscribe to own notifications
    27         # subscribe to own notifications
    28         response = c.post('/notifications/', {'notif_id': u'own_notify_check', 
    28         response = c.post('/followup/', {'notif_id': u'own_notify_check', 
    29                                               'own_notify_check': u'true',
    29                                          'own_notify_check': u'true',
    30                                               })
    30                                         })
    31         
    31         
    32         self.assertEquals(len(Notification.objects.all()), 2)
    32         self.assertEquals(len(Notification.objects.all()), 2)
    33 
    33 
    34         self.assertEquals(len(mail.outbox), 0)        
    34         self.assertEquals(len(mail.outbox), 0)        
    35 
    35 
    37                             'end_offset' : 19,
    37                             'end_offset' : 19,
    38                             'end_wrapper' : 0,
    38                             'end_wrapper' : 0,
    39                             'format' : 'markdown',
    39                             'format' : 'markdown',
    40                             'fun' : 'addComment',
    40                             'fun' : 'addComment',
    41                             'key' : 'text_key_1',
    41                             'key' : 'text_key_1',
       
    42                             'version_key' : 'textversion_key_1',
    42                             'start_offset' : 16,
    43                             'start_offset' : 16,
    43                             'start_wrapper' : 0,
    44                             'start_wrapper' : 0,
    44                             'title' : 'sdf', 
    45                             'title' : 'sdf', 
    45                             'tags': '',   
    46                             'tags': '',   
    46                             })
    47                             })