コード例 #1
0
 def test_set_question_converts_multiplication_operator_to_entity(self):
     w = MathCaptchaWidget()
     w.set_question(2, 4, '*')
     self.assertHTMLEqual(w.question_html, """
         <span class="captcha-question">
             What is 2 &times; 4?
         </span>""")
コード例 #2
0
 def test_set_question(self):
     w = MathCaptchaWidget()
     w.set_question(2, 4, 'foo')
     self.assertHTMLEqual(w.question_html, """
         <span class="captcha-question">
             What is 2 foo 4?
         </span>""")
コード例 #3
0
 def test_set_question_used_question_class(self):
     w = MathCaptchaWidget(question_class='question')
     w.set_question(2, 4, '+')
     self.assertHTMLEqual(w.question_html, """
         <span class="question">
             What is 2 + 4?
         </span>""")
コード例 #4
0
 def test_set_question(self):
     w = MathCaptchaWidget()
     w.set_question(2, 4, 'foo')
     self.assertHTMLEqual(
         w.question_html, """
         <span class="captcha-question">
             What is 2 foo 4?
         </span>""")
コード例 #5
0
 def test_set_question_used_question_class(self):
     w = MathCaptchaWidget(question_class='question')
     w.set_question(2, 4, '+')
     self.assertHTMLEqual(
         w.question_html, """
         <span class="question">
             What is 2 + 4?
         </span>""")
コード例 #6
0
 def test_set_question_converts_multiplication_operator_to_entity(self):
     w = MathCaptchaWidget()
     w.set_question(2, 4, '*')
     self.assertHTMLEqual(
         w.question_html, """
         <span class="captcha-question">
             What is 2 &times; 4?
         </span>""")
コード例 #7
0
 def test_set_question_converts_multiplication_operator_to_entity(self):
     w = MathCaptchaWidget()
     w.set_question(2, 4, '*')
     self.assertHTMLEqual(w.question_html, "What is 2 &times; 4?")
コード例 #8
0
 def test_set_question(self):
     w = MathCaptchaWidget()
     w.set_question(2, 4, 'foo')
     self.assertHTMLEqual(w.question_html, "What is 2 foo 4?")
コード例 #9
0
 def test_set_question_converts_multiplication_operator_to_entity(self):
     w = MathCaptchaWidget()
     w.set_question(2, 4, '*')
     self.assertHTMLEqual(w.question_html, "What is 2 &times; 4?")
コード例 #10
0
 def test_set_question(self):
     w = MathCaptchaWidget()
     w.set_question(2, 4, 'foo')
     self.assertHTMLEqual(w.question_html, "What is 2 foo 4?")