Browse Source

Fixed a bug where a string value would not be unqouted

tags/0.2.1
Johann Schmitz 4 years ago
parent
commit
45c6413931
Signed by: ercpe <johann@j-schmitz.net> GPG Key ID: A084064277C501ED
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      src/phylter/backends/base.py
  2. +1
    -0
      tests/test_backends.py

+ 1
- 1
src/phylter/backends/base.py View File

@@ -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
- 0
tests/test_backends.py View File

@@ -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


Loading…
Cancel
Save