Example #1
0
 def test_decode_from_json(self):
     self.app.conf.elasticsearch_save_meta_as_text, prev = False, self.app.conf.elasticsearch_save_meta_as_text
     try:
         x = ElasticsearchBackend(app=self.app)
         result_meta = x._get_result_meta({'solution': 42}, states.SUCCESS, None, None)
         result_meta['result'] = x._encode(result_meta['result'])[2]
         assert x.decode(result_meta) == result_meta
     finally:
         self.app.conf.elasticsearch_save_meta_as_text = prev