Fixes on fieldstest
This commit is contained in:
parent
1cd2fa0c68
commit
d5ff46e6aa
2 changed files with 33 additions and 1 deletions
26
tests/fieldstest.py
Normal file
26
tests/fieldstest.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
from settings import config
|
||||
from paramecio.cromosoma.webmodel import WebModel
|
||||
from paramecio.cromosoma import corefields
|
||||
import unittest
|
||||
|
||||
class TestFieldMethods(unittest.TestCase):
|
||||
|
||||
def test_phangofield(self):
|
||||
|
||||
field=corefields.PhangoField('example', 255)
|
||||
|
||||
field.required=True
|
||||
|
||||
field.check('')
|
||||
|
||||
self.assertTrue(field.error)
|
||||
|
||||
field.check('content')
|
||||
|
||||
self.assertFalse(field.error)
|
||||
|
||||
value=field.check("injection_'")
|
||||
|
||||
self.assertEqual(value, "injection_\\'")
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue