Пример #1
0
 def test_list_docs(self):
   # List documents where locale = fr.
   collection = self.pod.get_collection('pages')
   documents = collection.list_docs(locale='fr')
   for doc in documents:
     self.assertEqual('fr', doc.locale)
   # List unhidden documents.
   documents = collection.list_docs()
   for doc in documents:
     self.assertFalse(doc.hidden)
   # List all documents.
   documents = collection.list_docs(include_hidden=True)
   collection = self.pod.get_collection('posts')
   documents = collection.list_docs(order_by='$published', reverse=True)
   expected = ['newest', 'newer', 'older', 'oldest']
   self.assertListEqual(expected, [doc.base for doc in documents])
Пример #2
0
 def test_empty_front_matter(self):
   collection = self.pod.get_collection('empty-front-matter')
   docs = collection.list_docs()
   path = '/content/empty-front-matter/empty-front-matter.html'
   expected_doc = self.pod.get_doc(path)
   self.assertEqual(expected_doc, docs[0])