class SingleReferenceTestCase(TestCase):

    def setUp(self):
        self.reference = Reference(bibtex=fluff)
        self.reference.save()

    def test_key(self):
        """Check that the key can be extracted"""
        self.assertEqual(self.reference.key, 'steinhauser2009nature')

    def test_year(self):
        """Check that the year can be extracted"""
        self.assertEqual(self.reference.get_year(), 2009)

    def test_title(self):
        """Check that the title can be extracted"""
        self.assertEqual(self.reference.get_title(), "The nature of navel fluff")

    def test_authors(self):
        """Check that authors can be extracted"""
        self.assertIn('Steinhauser', self.reference.get_authors())
    
    def test_html(self):
        """Check that the html is output correctly"""
        self.assertEqual(self.reference.get_html(csl=csl), html)

    def test_abstract(self):
        """Check that the abstract is returned"""    
        self.assertIn('lint', self.reference.get_abstract())
        self.assertIn('Why do men have nipples', self.reference.get_abstract())
Beispiel #2
0
class SingleReferenceTestCase(TestCase):
    def setUp(self):
        self.reference = Reference(bibtex=fluff)
        self.reference.save()

    def test_key(self):
        """Check that the key can be extracted"""
        self.assertEqual(self.reference.key, 'steinhauser2009nature')

    def test_year(self):
        """Check that the year can be extracted"""
        self.assertEqual(self.reference.get_year(), 2009)

    def test_title(self):
        """Check that the title can be extracted"""
        self.assertEqual(self.reference.get_title(),
                         "The nature of navel fluff")

    def test_authors(self):
        """Check that authors can be extracted"""
        self.assertIn('Steinhauser', self.reference.get_authors())

    def test_html(self):
        """Check that the html is output correctly"""
        self.assertEqual(self.reference.get_html(csl=csl), html)

    def test_abstract(self):
        """Check that the abstract is returned"""
        self.assertIn('lint', self.reference.get_abstract())
        self.assertIn('Why do men have nipples', self.reference.get_abstract())
 def test_accent(self):
     reference = Reference(bibtex=erdos)
     self.assertEqual(reference.get_authors(), u'B Bollob\u2019as & P Erdos')
Beispiel #4
0
 def test_accent(self):
     reference = Reference(bibtex=erdos)
     self.assertEqual(reference.get_authors(),
                      u'B Bollob\u2019as & P Erdos')