mdipierro
b58b7da18f
validatos no longer depend on T
2019-02-24 01:51:18 -08:00
Seth Kinast
0077f29d71
gluon.validators: update IS_STRONG to behave as it did in web2py < 2.15
...
We used to compare `type(self.upper) == int` but the check was changed
to `isinstance(self.upper, int)`. Because bool is an instance of int but is not
the type int, the meaning of the checks changed to treat False as 0.
This patch specifically differentiates between False and 0.
- False means "no requirements for this character class".
- 0 means "exactly 0 of this character class".
Fixes #2093
2019-02-13 21:14:05 -08:00
mdipierro
ddc99b3552
validators are back in web2py for now
2019-02-10 22:15:12 -08:00
mdipierro
cf278d3741
validators now tested in pydal and code moved there
2019-02-10 21:32:31 -08:00
Vinyl Darkscratch
62df950f50
Add aspect ratio validation tests
2018-11-03 21:17:13 -08:00
mdipierro
319490edc1
fixed one more test
2018-06-01 13:19:35 -05:00
mdipierro
7fce2d04af
fixed tests for IS_LIST_OF
2018-06-01 12:56:45 -05:00
Leonel Câmara
dfa6703420
test IS_EMPTY_OR with a list and tuple
2018-02-26 19:59:21 +00:00
geomapdev
c1a3d5d67e
sync with master branch
2017-10-31 14:47:07 -07:00
geomapdev
6b103f7e3a
updated test_validators IS_IN_DB
2017-10-10 08:42:17 -07:00
geomapdev
02c32ebace
update gluon unittest for dal reference fields
2017-10-09 11:22:48 -07:00
tiago.bar
511245a68c
Unit test for #1764 fix
2017-09-23 20:21:14 -03:00
Leonel Câmara
617ca4a98d
Fixes #1639
2017-06-05 23:52:25 +01:00
mdipierro and GitHub
baa129f871
Merge pull request #1527 from leonelcamara/authapi2
...
Auth refactor
2017-05-01 09:13:18 -05:00
mdipierro and GitHub
496112c4fe
Merge pull request #1604 from ilvalle/fix_1570
...
prevent is_empty from stripping whitespaces, close #1570
2017-04-28 08:07:20 -05:00
ilvalle
7a69e087f7
prevent is_empty from stripping whitespaces, close #1570
2017-04-06 20:48:12 +02:00
ilvalle
6da3a9d8fd
fix is_email with internationalized Domain Names, close #1582
2017-04-05 22:16:21 +02:00
ilvalle
637579f531
replaced ipaddr with ipaddress.py (backported from py3)
2016-12-03 08:42:35 +01:00
Leonel Câmara
02f0bdb8d3
Auth refactor, extracted many methods into a base class for more generic auth mechanisms.
...
Partially addresses #1526
Includes a solution for IS_LOWER and IS_UPPER validator problems I mentioned in #1353
2016-11-05 16:37:22 +00:00
Chris Garcia
4226b6d0e1
Corrected use of 'lowercase' and 'uppercase' to fix #1515
2016-10-28 15:23:18 -05:00
niphlod
1bf499e3be
first step towards dropping sys.path dance
2016-08-29 23:01:22 +02:00
Giovanni Barillari
0528a347b3
Updated pyDAL to 16.08
2016-08-13 15:38:55 +02:00
mdipierro
35eaba1096
removed duplicated code, using pydal's _compat.py
2016-08-01 03:39:22 -05:00
niphlod
cae10a68c0
fixed most of py3 warnings, output is much cleaner this way
2016-07-18 23:45:28 +02:00
ilvalle
fd850ab46f
fix validators, updated gluon/contrib/ipaddr
2016-06-07 19:50:49 +02:00
ilvalle
a1fd92b7f8
updated imports in tests
2016-06-02 14:28:21 +02:00
Leonel Câmara
1029a70d10
more tests for languages module
...
removed 2.5/2.6 compatibility in test_validators.py
2016-05-12 02:00:14 +01:00
Leonel Câmara
810520b3f0
more tests for validators
2016-05-03 02:38:50 +01:00
Leonel Câmara
9a3e73031b
fixes #1266 and adds tests to make sure it doesn't happen again
2016-04-14 01:02:25 +01:00
Leonel Câmara
9552d9d6d0
fixed sort=True test
2016-04-12 16:28:33 +01:00
Leonel Câmara
9ead66b6db
test IS_IN_DB label is a Field and self.sort = True
2016-04-12 16:00:33 +01:00
Leonel Câmara
5c292640ba
Complete coverage for IS_IN_SET
...
Removed unreachable code in IS_IN_SET
if failures and self.theset:
if self.multiple and (value is None or value == '')
It's impossible to have *failures* and have value be None or '' at the same time
2016-03-28 14:47:58 +01:00
Leonel Câmara
5cbf381a2c
More test coverage for validators.py
...
Fixed a bug in IS_EMAIL throwing exceptions when asked to validate anything other than a string which was problematic for ANY_OF
Fixed a bug in ANY_OF.formatter where it was trying to format with a validator that didn't validate
2016-03-27 14:23:24 +01:00
Richard Vézina
52392a10ae
Improve PEP8 just a bit + more coverage
2016-03-24 10:44:37 -04:00
Leonel Câmara
8683b0680d
add test for something that is NOT an image
2016-03-19 14:55:16 +00:00
Leonel Câmara
fbb5776432
test_IS_IMAGE
...
Removed unused and undocumented IS_IN_SUBSET
Fixed _options IS_EMPTY_OR not passing arguments to the other options method
Some tests for formatters
2016-03-19 12:52:48 +00:00
Leonel Câmara
98d33bdded
Tests for IS_IN_DB, IS_NOT_IN_DB, IS_URL (also tests IS_HTTP_URL IS_GENERIC_URL)
2016-03-14 23:59:08 +00:00
mdipierro
1d04f8837e
resorted tests as suggested by BuhtigithuB
2016-03-14 12:16:52 -05:00
mdipierro
a375e047e9
Leonel new tests gluon/tests/test_validators.py
2016-03-14 12:04:47 -05:00
Richard Vézina
2531c2c640
Improve PEP8
2016-03-10 22:09:38 -05:00
Richard Vézina
eca300af32
Order tests to match validators.py and flag missing tests
2016-03-10 21:56:46 -05:00
niphlod
d4ffcaf1b1
fixes #1044
...
This shouldn't have took that much to solve. Really sorry for the delay
2015-12-30 16:38:43 +01:00
niphlod
e62bead5e2
fixes issue #773
...
Removed redundant tests in test_validators.py since there's test_isurl.py
Added allowed_tlds from http://data.iana.org/TLD/tlds-alpha-by-domain.txt
Added script to easily update the official_top_level_domains for the future
2015-02-24 23:34:27 +01:00
niphlod
17f4e46423
fixes issue #742
2015-02-23 21:34:23 +01:00
niphlod
34a417cfa0
fix for StorageList and tests added
...
gluon/storage.py
StorageList had a recursion error (please check the implementation before committing)
gluon/tests*
added the fix_path module to avoid those ugly lines at the beginning of each test file
added tests for gluon.contenttype and test_fileutils
added tests for missing Storage methods
2014-09-21 08:26:38 +02:00
niphlod
8bbd22eba8
improved coverage, fix bug with IS_LIST_OF and items not being strings
2014-09-19 00:15:25 +02:00
niphlod
0c6eaf536a
someone forgot tests.... grrrr!
2014-01-20 21:28:44 +01:00
niphlod
78a0fe0769
removed unmaintained test.sh, ported validators doctests to unittests, fixed an issue with IS_MATCH() that never worked
2013-10-13 17:48:07 +02:00