use encode_json instead of j in tests