from mock_neomodel.core import FakeNode
from mock_neomodel.relationship_manager import FakeRelation


class FakeLocalised(object):

    def __init__(self, *args, **kwargs):
        super(FakeLocalised, self).__init__(*args, **kwargs)
        self.locales = FakeRelation(self)

    def add_locale(self, lang):
        self.locales.connect(FakeNode(code=lang).save())

    def remove_locale(self, lang):
        self.locales.disconnect(FakeNode.index.get(code=lang))

    def has_locale(self, lang):
        self.locales.is_connected(FakeNode.index.get(code=lang))

7f6057b8edc0082c3a5a268ea95e6342e565f36c
<mask token>


class FakeLocalised(object):
    <mask token>
    <mask token>
    <mask token>

    def has_locale(self, lang):
        self.locales.is_connected(FakeNode.index.get(code=lang))

<mask token>


class FakeLocalised(object):
    <mask token>

    def add_locale(self, lang):
        self.locales.connect(FakeNode(code=lang).save())

    def remove_locale(self, lang):
        self.locales.disconnect(FakeNode.index.get(code=lang))

    def has_locale(self, lang):
        self.locales.is_connected(FakeNode.index.get(code=lang))

<mask token>


class FakeLocalised(object):

    def __init__(self, *args, **kwargs):
        super(FakeLocalised, self).__init__(*args, **kwargs)
        self.locales = FakeRelation(self)

    def add_locale(self, lang):
        self.locales.connect(FakeNode(code=lang).save())

    def remove_locale(self, lang):
        self.locales.disconnect(FakeNode.index.get(code=lang))

    def has_locale(self, lang):
        self.locales.is_connected(FakeNode.index.get(code=lang))

from mock_neomodel.core import FakeNode
from mock_neomodel.relationship_manager import FakeRelation


class FakeLocalised(object):

    def __init__(self, *args, **kwargs):
        super(FakeLocalised, self).__init__(*args, **kwargs)
        self.locales = FakeRelation(self)

    def add_locale(self, lang):
        self.locales.connect(FakeNode(code=lang).save())

    def remove_locale(self, lang):
        self.locales.disconnect(FakeNode.index.get(code=lang))

    def has_locale(self, lang):
        self.locales.is_connected(FakeNode.index.get(code=lang))
