'A document\'s categories must always be those of its parent.'

def test_category_inheritance(self):

    some_category = CATEGORIES[1][0]
    other_category = CATEGORIES[2][0]
    assert (some_category != DocumentFactory().category)
    parent = DocumentFactory(category=some_category)
    child = DocumentFactory(parent=parent, locale='de')
    eq_(some_category, child.category)
    child.category = other_category
    child.save()
    eq_(some_category, child.category)
    parent.category = other_category
    parent.save()
    eq_(other_category, parent.translations.get(locale=child.locale).category)
