Browse Source

fix unit test error

Acey9 8 years ago
parent
commit
d3ec0ee528
1 changed files with 2 additions and 1 deletions
  1. 2 1
      t/unit/backends/test_elasticsearch.py

+ 2 - 1
t/unit/backends/test_elasticsearch.py

@@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
 import pytest
 import pytest
 from case import Mock, sentinel, skip
 from case import Mock, sentinel, skip
 from celery.app import backends
 from celery.app import backends
+from celery.five import string
 from celery.backends import elasticsearch as module
 from celery.backends import elasticsearch as module
 from celery.backends.elasticsearch import ElasticsearchBackend
 from celery.backends.elasticsearch import ElasticsearchBackend
 from celery.exceptions import ImproperlyConfigured
 from celery.exceptions import ImproperlyConfigured
@@ -95,7 +96,7 @@ class test_ElasticsearchBackend:
         body = {"field1": "value1"}
         body = {"field1": "value1"}
         x._index(id=sentinel.task_id, body=body, kwarg1='test1')
         x._index(id=sentinel.task_id, body=body, kwarg1='test1')
         x._server.index.assert_called_once_with(
         x._server.index.assert_called_once_with(
-            id=sentinel.task_id,
+            id=string(sentinel.task_id),
             doc_type=x.doc_type,
             doc_type=x.doc_type,
             index=x.index,
             index=x.index,
             body=body,
             body=body,