Esempio n. 1
0
    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())
Esempio n. 2
0
    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())
Esempio n. 3
0
 def test_only_approved_have_related(self):
     calculate_related_documents()
     d = Document.uncached.get(pk=3)
     eq_(0, d.related_documents.count())
Esempio n. 4
0
 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
Esempio n. 5
0
 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)
Esempio n. 6
0
 def test_only_approved_have_related(self):
     calculate_related_documents()
     d = Document.uncached.get(pk=3)
     eq_(0, d.related_documents.count())
Esempio n. 7
0
 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
Esempio n. 8
0
 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)