<filename>we-web/services/mocks/yandex_translate.py
# coding=utf-8

import json


class YandexTranslateFake(object):
    def translate(self, text, direction):
        response =u'{"lang": "en-ru", "text": ["собака"], "code": 200}'

        return json.loads(response)

    def detect(self, text):
        return u'en'
<filename>we-web/services/mocks/yandex_translate.py
# coding=utf-8

import json


class YandexTranslateFake(object):
    def translate(self, text, direction):
        response =u'{"lang": "en-ru", "text": ["собака"], "code": 200}'

        return json.loads(response)

    def detect(self, text):
        return u'en'
# coding=utf-8