Changeset 877

Show
Ignore:
Timestamp:
06/08/07 04:53:22
Author:
mylan
Message:

Fix plone-2.0.5 tests incorrectness.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPloneComments/trunk/tests/helperNotify.py

    r875 r877  
    4343 
    4444def _send_MH( self, mfrom, mto, messageText ): 
    45     files = [f for f in os.listdir('./output') if f.startswith('mail')] 
    46     fn = files[-1]+ '1' 
     45    files = [f for f in os.listdir(output_file_path("")) if f.startswith('mail')] 
     46    files.sort() 
     47    fn = files and (files[-1]+ '1') or 'mail' 
    4748    writeToFile(output_file_path(fn), messageText) 
    4849 
    4950def _send_SMH(self, mfrom, mto, messageText, debug=False): 
    50     files = [f for f in os.listdir('./output') if f.startswith('mail')] 
    51     fn = files[-1]+ '1' 
     51    files = [f for f in os.listdir(output_file_path("")) if f.startswith('mail')] 
     52    files.sort() 
     53    fn = files and (files[-1]+ '1') or 'mail' 
    5254    writeToFile(output_file_path(fn), messageText) 
    5355 
    5456def send_SMH(self, message, mto=None, mfrom=None, subject=None, encode=None): 
    55     files = [f for f in os.listdir('./output') if f.startswith('mail')] 
     57    files = [f for f in os.listdir(output_file_path("")) if f.startswith('mail')] 
    5658    files.sort() 
    57     if files: 
    58         fn = files[-1]+ '1' 
    59     else: 
    60         fn = 'mail' 
     59    fn = files and (files[-1]+ '1') or 'mail' 
    6160    writeToFile(output_file_path(fn), message) 
    6261 
     
    8483 
    8584def cleanOutputDir(): 
    86     for f in os.listdir('./output'): 
    87         if f.startswith('mail'): os.remove('./output/%s'%f
     85    for f in os.listdir(output_file_path("")): 
     86        if f.startswith('mail'): os.remove(output_file_path(f)
  • qPloneComments/trunk/tests/testQPloneCommentsModeration.py

    r805 r877  
    161161                                 re.S|re.M) 
    162162        else: 
    163             pattern = re.compile('.*<input\\s*class="standalone"\\s*type="submit"\\s*value="Publish This Discussion"\\s*/>',\ 
    164                                  re.S|re.M) 
     163            pattern = re.compile('.*<input\\s*class="standalone"\\s*type="submit"\\s*value="Publish"\\s*/>',\ 
     164                                 re.S|re.M) 
     165                                #<input class="standalone" value="Publish" type="submit"> 
    165166        for u in DM_USERS_IDS: 
    166167            self.logout() 
     
    230231                                 re.S|re.M) 
    231232        else: 
    232             pattern = re.compile('.*<input\\s*class="destructive"\\s*type="submit"\\s*value="Remove This Discussion"\\s*/>',\ 
     233            pattern = re.compile('.*<input\\s*class="destructive"\\s*type="submit"\\s*value="Remove"\\s*/>',\ 
    233234                                 re.S|re.M) 
    234235        for u in COMMON_USERS_IDS: 
  • qPloneComments/trunk/tests/testQPloneCommentsNotification.py

    r875 r877  
    171171                     , 'No notification for publishing comment' % properties) 
    172172 
     173    def test_bug_notification_on_single_reply_delete(self): 
     174        """ Bug: no notification sent on deleting single comment. 
     175            Mail about rejecing comment should be sent to comentator. 
     176        """ 
     177        properties = ['enable_rejected_user_notification',] 
     178        setProperties(self.prefs, *properties) 
     179        #setProperties(self.prefs, 'enable_published_notification', ) 
     180        self.my_doc.discussion_reply('A Reply for my_doc' ,'text of reply for my_doc') 
     181        reply = self.discussion.getDiscussionFor(self.my_doc).getReplies()[0] 
     182 
     183        cleanOutputDir() 
     184        reply.deleteDiscussion() 
     185        mails = getMails() 
     186        self.assert_([1 for m in mails if re.search('^Subject:.*(not approved).*$', m, re.I|re.M)] \ 
     187                     ,'No notification for rejecting comment' % properties) 
     188 
    173189 
    174190TESTS = [TestNotification]