@@ -582,6 +582,50 @@ def test_fail_answer_with_no_right(self):
582
582
self .assertEqual (403 , response .status_code )
583
583
self .assertEqual (2 , PrivatePost .objects .all ().count ())
584
584
585
+ def test_unicode_title_answer (self ):
586
+ """To test unicode title."""
587
+
588
+ unicodeTopic = PrivateTopicFactory (author = self .profile1 .user ,
589
+ title = u'Title with accent àéè' )
590
+ unicodeTopic .participants .add (self .profile2 .user )
591
+ unicodePost = PrivatePostFactory (
592
+ privatetopic = unicodeTopic ,
593
+ author = self .profile1 .user ,
594
+ position_in_topic = 1 )
595
+
596
+ response = self .client .post (
597
+ reverse ('zds.mp.views.answer' )
598
+ + '?sujet=' + str (unicodeTopic .pk ),
599
+ {
600
+ 'text' : 'answer' ,
601
+ 'last_post' : unicodePost .pk
602
+ },
603
+ follow = True
604
+ )
605
+ self .assertEqual (response .status_code , 200 )
606
+
607
+ def test_unicode_subtitle_answer (self ):
608
+ """To test unicode subtitle."""
609
+
610
+ unicodeTopic = PrivateTopicFactory (author = self .profile1 .user ,
611
+ subtitle = u'Subtitle with accent àéè' )
612
+ unicodeTopic .participants .add (self .profile2 .user )
613
+ unicodePost = PrivatePostFactory (
614
+ privatetopic = unicodeTopic ,
615
+ author = self .profile1 .user ,
616
+ position_in_topic = 1 )
617
+
618
+ response = self .client .post (
619
+ reverse ('zds.mp.views.answer' )
620
+ + '?sujet=' + str (unicodeTopic .pk ),
621
+ {
622
+ 'text' : 'answer' ,
623
+ 'last_post' : unicodePost .pk
624
+ },
625
+ follow = True
626
+ )
627
+ self .assertEqual (response .status_code , 200 )
628
+
585
629
586
630
class EditPostViewTest (TestCase ):
587
631
0 commit comments