mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-02-16 19:40:36 +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 = {
|
||||
"allReporters": {
|
||||
"edges": [
|
||||
{"node": {"id": base64.b64encode("ReporterType:{}".format(reporter.id).encode())}},
|
||||
{"node": {"id": base64.b64encode("ReporterType:{}".format(cnn_reporter.id).encode())}},
|
||||
{"node": {"id": str_to_node_id("ReporterType:{}".format(reporter.id))}},
|
||||
{"node": {"id": str_to_node_id("ReporterType:{}".format(cnn_reporter.id))}},
|
||||
]
|
||||
},
|
||||
"cnnReporters": {
|
||||
"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