Changeset 1465 in products


Ignore:
Timestamp:
Dec 21, 2009 2:02:43 PM (11 years ago)
Author:
crchemist
Message:

fix test_bug_notification_on_single_reply_delete

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonecomments/trunk/quintagroup/plonecomments/tests/testQPloneCommentsNotification.py

    r880 r1465  
    77 
    88from Products.CMFCore.permissions import ManagePortal, ReplyToItem 
    9  
     9import base64 
     10from email import message_from_string 
    1011from quintagroup.plonecomments.utils import getMsg 
    1112from base import getToolByName, FunctionalTestCase 
     
    175176        reply.deleteDiscussion() 
    176177        mails = getMails() 
    177         regexp = re.compile("Subject:\s*(.*?)$",re.M) 
    178         subject = str(Header('Your comment on "Doc" was not approved', 'utf-8')) 
    179         self.failUnless([1 for m in mails if regexp.search(m).group(1) == subject], 
     178        subject = str(Header('Your comment on Doc was not approved', 'utf-8')) 
     179        subjs = [message_from_string(m)['Subject'] for m in mails] 
     180        self.failUnless([1 for m in subjs if m == subject], 
    180181            'No notification for rejecting comment.' % properties) 
    181182 
Note: See TracChangeset for help on using the changeset viewer.