@@ -3333,6 +3333,68 @@ def testEmailQuotingNewIsFollowup(self):
3333
3333
self .assertEqual (content , '''This is a followup''' )
3334
3334
self .assertEqual (summary , '''This is a followup''' )
3335
3335
3336
+ fourthquotingtest = '''Content-Type: text/plain;
3337
+ charset="iso-8859-1"
3338
+
3339
+
3340
+ Message-Id: <followup_dummy_id>
3341
+ In-Reply-To: <dummy_test_message_id>
3342
+ Subject: Re: [issue1] Testing...
3343
+
3344
+ Blah blah wrote:
3345
+ > Blah bklaskdfj sdf asdf jlaskdf skj sdkfjl asdf
3346
+ > skdjlkjsdfalsdkfjasdlfkj dlfksdfalksd fj
3347
+ >
3348
+
3349
+ This is a followup
3350
+
3351
+ > mumble mumble but
3352
+ > more mumble mumble
3353
+
3354
+ I see your mubble and raise you a mumble.
3355
+
3356
+ But I also have a full house which beats your
3357
+ >mumbler
3358
+
3359
+ so I win.
3360
+ '''
3361
+ def testEmailBodyUnchangedNewIsNo (self ):
3362
+ """verify that only the signature is stripped"""
3363
+
3364
+ mysig = "\n --\n my sig\n \n "
3365
+ self .instance .config .EMAIL_LEAVE_BODY_UNCHANGED = 'no'
3366
+ # create the message, remove the prefix from subject
3367
+ testmessage = self .fourthquotingtest .replace (" Re: [issue1]" , "" ) + mysig
3368
+ print (testmessage )
3369
+ print ("\n ======\n " )
3370
+ nodeid = self ._handle_mail (testmessage )
3371
+
3372
+ msgs = self .db .issue .get (nodeid , 'messages' )
3373
+ # validate content and summary
3374
+ content = self .db .msg .get (msgs [0 ], 'content' )
3375
+ print (content )
3376
+ self .assertIn (content , '''Blah blah wrote:
3377
+ > Blah bklaskdfj sdf asdf jlaskdf skj sdkfjl asdf
3378
+ > skdjlkjsdfalsdkfjasdlfkj dlfksdfalksd fj
3379
+ >
3380
+
3381
+ This is a followup
3382
+
3383
+ > mumble mumble but
3384
+ > more mumble mumble
3385
+
3386
+ I see your mubble and raise you a mumble.
3387
+
3388
+ But I also have a full house which beats your
3389
+ >mumbler
3390
+
3391
+ so I win.
3392
+ '''
3393
+ )
3394
+
3395
+ summary = self .db .msg .get (msgs [0 ], 'summary' )
3396
+ self .assertEqual (summary , '''This is a followup''' )
3397
+
3336
3398
def testEmailBodyUnchangedNewIsYes (self ):
3337
3399
mysig = "--\n my sig\n \n "
3338
3400
self .instance .config .EMAIL_LEAVE_BODY_UNCHANGED = 'yes'
0 commit comments