'Links should use the correct locale.'

def test_locales_exists(self):

    d1 = DocumentFactory(title='Foo', locale='en-US')
    RevisionFactory(document=d1, content='', is_approved=True)
    d2 = DocumentFactory(title='Foo', locale='de')
    RevisionFactory(document=d2, content='', is_approved=True)
    d3 = DocumentFactory(title='Bar', locale='de')
    RevisionFactory(document=d3, content='[[Foo]]', is_approved=True)
    eq_(len(d1.links_to()), 0)
    eq_(len(d1.links_from()), 0)
    eq_(len(d2.links_to()), 1)
    eq_(len(d2.links_from()), 0)
    eq_(len(d3.links_to()), 0)
    eq_(len(d3.links_from()), 1)
    eq_(d2.links_to()[0].kind, 'link')
