add encoding
This commit is contained in:
14
tests/test_queries/test_utils.py
Normal file
14
tests/test_queries/test_utils.py
Normal file
@ -0,0 +1,14 @@
|
||||
import json
|
||||
|
||||
from ormar.queryset.utils import to_str
|
||||
|
||||
|
||||
def test_to_str():
|
||||
expected_str = "[]"
|
||||
val = json.dumps([])
|
||||
assert expected_str == to_str(val)
|
||||
|
||||
expected_bytes = expected_str.encode()
|
||||
assert isinstance(expected_bytes, bytes)
|
||||
|
||||
assert isinstance(to_str(expected_bytes), str)
|
||||
Reference in New Issue
Block a user