def test_related_documents_calculated(self): d = Document.uncached.get(pk=1) eq_(0, d.related_documents.count()) calculate_related_documents() d = Document.uncached.get(pk=1) eq_(2, d.related_documents.count())
def test_only_approved_have_related(self): calculate_related_documents() d = Document.uncached.get(pk=3) eq_(0, d.related_documents.count())
def test_only_approved_revisions(self): calculate_related_documents() d = Document.uncached.get(pk=1) for rd in d.related_documents.all(): assert rd.current_revision
def test_related_only_locale(self): calculate_related_documents() d = Document.uncached.get(pk=1) for rd in d.related_documents.all(): eq_('en-US', rd.locale)