Fixes in tests and html escaping
This commit is contained in:
parent
9e1e48e0e9
commit
61a2d53308
10 changed files with 77 additions and 22 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from settings import config
|
||||
from paramecio.cromosoma.webmodel import WebModel
|
||||
from paramecio.cromosoma import corefields
|
||||
from paramecio.cromosoma.extrafields.emailfield import EmailField
|
||||
import unittest
|
||||
|
||||
class TestFieldMethods(unittest.TestCase):
|
||||
|
|
@ -21,7 +22,7 @@ class TestFieldMethods(unittest.TestCase):
|
|||
|
||||
value=field.check("injection_'")
|
||||
|
||||
self.assertEqual(value, "injection_\\'")
|
||||
self.assertEqual(value, "injection_'")
|
||||
|
||||
def test_integerfield(self):
|
||||
|
||||
|
|
@ -40,4 +41,19 @@ class TestFieldMethods(unittest.TestCase):
|
|||
value=integerfield.check("25'")
|
||||
|
||||
self.assertEqual(value, "0")
|
||||
|
||||
|
||||
def test_emailfield(self):
|
||||
|
||||
emailfield=EmailField('email')
|
||||
|
||||
emailfield.required=True
|
||||
|
||||
emailfield.check('exampleweb-t-sys.com')
|
||||
|
||||
self.assertTrue(emailfield.error)
|
||||
|
||||
emailfield.check('example@web-t-sys.com')
|
||||
|
||||
self.assertFalse(emailfield.error)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue