예제 #1
0
파일: test_models.py 프로젝트: swznd/kuma
    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())
예제 #2
0
파일: test_models.py 프로젝트: swznd/kuma
    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())
예제 #3
0
파일: test_models.py 프로젝트: swznd/kuma
 def test_only_approved_have_related(self):
     calculate_related_documents()
     d = Document.uncached.get(pk=3)
     eq_(0, d.related_documents.count())
예제 #4
0
파일: test_models.py 프로젝트: swznd/kuma
 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
예제 #5
0
파일: test_models.py 프로젝트: swznd/kuma
 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)
예제 #6
0
파일: test_models.py 프로젝트: swznd/kuma
 def test_only_approved_have_related(self):
     calculate_related_documents()
     d = Document.uncached.get(pk=3)
     eq_(0, d.related_documents.count())
예제 #7
0
파일: test_models.py 프로젝트: swznd/kuma
 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
예제 #8
0
파일: test_models.py 프로젝트: swznd/kuma
 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)