Browse Source

Fixed a bug where a string value would not be unqouted

Johann Schmitz 2 years ago
parent
commit
45c6413931
Signed by: Johann Schmitz <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):
28 28
 
29 29
 		value_type = type(value)
30 30
 
31
-		if field_type and value_type == field_type:
31
+		if field_type not in str_types and field_type and value_type == field_type:
32 32
 			return value
33 33
 
34 34
 		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):
56 56
 		assert ob.get_compatible_value(None) is None
57 57
 
58 58
 		# value is already of type
59
+		assert ob.get_compatible_value(1, int) == 1
59 60
 		assert ob.get_compatible_value("test", str) == "test"
60 61
 
61 62
 		# str