Firts upload
This commit is contained in:
commit
fae5555503
184 changed files with 19239 additions and 0 deletions
43
tests/i18nfieldtest.py
Normal file
43
tests/i18nfieldtest.py
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
from settings import config
|
||||
from cuchulu.libraries.db.extrafields.i18nfield import I18nField
|
||||
from cuchulu.libraries.httputils import GetPostFiles
|
||||
from cuchulu.libraries.i18n import I18n
|
||||
import unittest
|
||||
|
||||
class TestFieldMethods(unittest.TestCase):
|
||||
|
||||
def test_i18nfield(self):
|
||||
"""
|
||||
field=I18nField('i18n')
|
||||
|
||||
value=field.check({})
|
||||
|
||||
self.assertTrue(field.error)
|
||||
|
||||
value=field.check({'i18n_es-ES': 'Mi text', 'i18n_en-US': 'My Text'})
|
||||
|
||||
self.assertFalse(field.error)
|
||||
|
||||
GetPostFiles.post={'i18n_es-ES': 'Mi text', 'i18n_en-US': 'My Text'}
|
||||
|
||||
value=field.check('')
|
||||
|
||||
self.assertFalse(field.error)
|
||||
|
||||
I18n.default_lang='en-US'
|
||||
|
||||
forms=GetPostFiles()
|
||||
|
||||
forms.post={'i18n_es-ES': 'My Text'}
|
||||
|
||||
value=field.check('')
|
||||
|
||||
self.assertTrue(field.error)
|
||||
"""
|
||||
|
||||
# Need fixes
|
||||
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue