mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-02-19 21:10:34 +03:00
Correctly encode / decode for python3+.
This commit is contained in:
parent
83a2ad34cd
commit
a461e80ee4
|
@ -947,16 +947,19 @@ def test_proxy_model_support():
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def str_to_node_id(val):
|
||||||
|
return base64.b64encode(val.encode()).decode()
|
||||||
|
|
||||||
expected = {
|
expected = {
|
||||||
"allReporters": {
|
"allReporters": {
|
||||||
"edges": [
|
"edges": [
|
||||||
{"node": {"id": base64.b64encode("ReporterType:{}".format(reporter.id).encode())}},
|
{"node": {"id": str_to_node_id("ReporterType:{}".format(reporter.id))}},
|
||||||
{"node": {"id": base64.b64encode("ReporterType:{}".format(cnn_reporter.id).encode())}},
|
{"node": {"id": str_to_node_id("ReporterType:{}".format(cnn_reporter.id))}},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"cnnReporters": {
|
"cnnReporters": {
|
||||||
"edges": [
|
"edges": [
|
||||||
{"node": {"id": base64.b64encode("CNNReporterType:{}".format(cnn_reporter.id).encode())}}
|
{"node": {"id": str_to_node_id("CNNReporterType:{}".format(cnn_reporter.id))}}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user