Example #1
0
 def test_valid_utf8(self):
     request = testing.DummyRequest(
         user=self.user1, remote_addr="0.0.0.0", method="POST", POST={"post_id": self.post.id, "comment": u"こんにちは世界"}
     )
     comment_create(request)
     cs = [comment.body for comment in self.post.comments]
     self.assertIn(u"こんにちは世界", cs)
Example #2
0
 def test_valid_utf8(self):
     request = testing.DummyRequest(user=self.user1,
                                    remote_addr="0.0.0.0",
                                    method="POST",
                                    POST={
                                        "post_id": self.post.id,
                                        "comment": u"こんにちは世界"
                                    })
     comment_create(request)
     cs = [comment.body for comment in self.post.comments]
     self.assertIn(u"こんにちは世界", cs)
Example #3
0
 def test_white(self):
     request = testing.DummyRequest(
         user=self.user1,
         remote_addr="0.0.0.0",
         method="POST",
         POST={"post_id": self.post.id, "comment": u"        "},
     )
     info = comment_create(request)
     self.assertIn("comment", info["form"].form.errors)
Example #4
0
 def test_white(self):
     request = testing.DummyRequest(user=self.user1,
                                    remote_addr="0.0.0.0",
                                    method="POST",
                                    POST={
                                        "post_id": self.post.id,
                                        "comment": u"        "
                                    })
     info = comment_create(request)
     self.assertIn("comment", info["form"].form.errors)