Changeset 877
- Timestamp:
- 06/08/07 04:53:22
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneComments/trunk/tests/helperNotify.py
r875 r877 43 43 44 44 def _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' 47 48 writeToFile(output_file_path(fn), messageText) 48 49 49 50 def _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' 52 54 writeToFile(output_file_path(fn), messageText) 53 55 54 56 def 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')] 56 58 files.sort() 57 if files: 58 fn = files[-1]+ '1' 59 else: 60 fn = 'mail' 59 fn = files and (files[-1]+ '1') or 'mail' 61 60 writeToFile(output_file_path(fn), message) 62 61 … … 84 83 85 84 def 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 161 161 re.S|re.M) 162 162 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"> 165 166 for u in DM_USERS_IDS: 166 167 self.logout() … … 230 231 re.S|re.M) 231 232 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*/>',\ 233 234 re.S|re.M) 234 235 for u in COMMON_USERS_IDS: qPloneComments/trunk/tests/testQPloneCommentsNotification.py
r875 r877 171 171 , 'No notification for publishing comment' % properties) 172 172 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 173 189 174 190 TESTS = [TestNotification]
