示例#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)