Browse Source

Fixed a bug where a string value would not be unqouted

master
Johann Schmitz 6 years ago
parent
commit
45c6413931
Signed by: ercpe GPG Key ID: A084064277C501ED
  1. 2
      src/phylter/backends/base.py
  2. 1
      tests/test_backends.py

2
src/phylter/backends/base.py

@ -28,7 +28,7 @@ class Backend(object):
value_type = type(value)
if field_type and value_type == field_type:
if field_type not in str_types and field_type and value_type == field_type:
return value
if field_type in str_types or (field_type is None and value_type in str_types):

1
tests/test_backends.py

@ -56,6 +56,7 @@ class TestBackends(object):
assert ob.get_compatible_value(None) is None
# value is already of type
assert ob.get_compatible_value(1, int) == 1
assert ob.get_compatible_value("test", str) == "test"
# str