Exemplo n.º 1
0
 def test_articles(self):
     """
     the article attribute should be read-only, and set the first time
     it is called
     """
     sr = SolrResponse(self.response.text)
     self.assertIsNone(sr._articles)
     self.assertEqual(len(sr.articles), 28)
     self.assertEqual(sr._articles, sr.articles)
     self.assertEqual(sr.articles[0].doi, [u'10.1126/science.174.4005.142'])
     with self.assertRaises(AttributeError):
         sr.articles = 'this should be read-only'