コード例 #1
0
ファイル: tests.py プロジェクト: marconi/django-mollom
 def testInvalidCaptcha(self):
     test_data = {
         "data": {
             "username": "******",
             "email": "*****@*****.**",
             "password1": "supersecure",
             "password2": "supersecure",
             "captcha": "randomstuff4321",
         },
         "error": ("captcha", [u"Liar! You don't seem to be human at all."]),
     }
     signup_form = MockSignupForm(data=test_data["data"])
     self.failIf(signup_form.is_valid())
     self.assertEqual(signup_form.errors[test_data["error"][0]], test_data["error"][1])
コード例 #2
0
ファイル: tests.py プロジェクト: marconi/django-mollom
 def testEmptyCaptchaField(self):
     test_data = {
         "data": {
             "username": "******",
             "email": "*****@*****.**",
             "password1": "supersecure",
             "password2": "supersecure",
             "captcha": "",
         },
         "error": ("captcha", [u"This field is required."]),
     }
     signup_form = MockSignupForm(data=test_data["data"])
     self.failIf(signup_form.is_valid())
     self.assertEqual(signup_form.errors[test_data["error"][0]], test_data["error"][1])