def setUp(self): self.report = report.CounterReport( report_type='JR1', report_version=4, customer=u'Foo', institutional_identifier=u'Bar', period=(datetime.date(2016, 1, 1), datetime.date(2016, 1, 31)) ) self.report.pubs.append( report.CounterJournal( period=(datetime.date(2016, 1, 1), datetime.date(2016, 1, 31)), month_data=[(datetime.date(2016, 1, 1), 260)], title=u'Fake Journal', publisher=u'No one', platform=u'Your imagination' ) ) self.report.pubs.append( report.CounterJournal( period=(datetime.date(2016, 1, 1), datetime.date(2016, 1, 31)), month_data=[(datetime.date(2016, 1, 1), 62)], title=u'Another Fake Journal', publisher=u'No one', platform=u'Your imagination' ) ) self.output_content = self.report.as_generic()
def setUp(self): self.report = report.CounterReport( report_type="JR1", report_version=4, customer=u"Foo", institutional_identifier=u"Bar", period=(datetime.date(2016, 1, 1), datetime.date(2016, 1, 31)), ) self.report.pubs.append( report.CounterJournal( period=(datetime.date(2016, 1, 1), datetime.date(2016, 1, 31)), month_data=[(datetime.date(2016, 1, 1), 260)], title=u"Fake Journal", publisher=u"No one", platform=u"Your imagination", ) ) self.report.pubs.append( report.CounterJournal( period=(datetime.date(2016, 1, 1), datetime.date(2016, 1, 31)), month_data=[(datetime.date(2016, 1, 1), 62)], title=u"Another Fake Journal", publisher=u"No one", platform=u"Your imagination", ) ) self.output_content = self.report.as_generic()
def test_report_gaps(): journal = report.CounterJournal( period=(datetime.date(2018, 1, 1), datetime.date(2018, 3, 1)), month_data=[(datetime.date(2018, 1, 1), 50), (datetime.date(2018, 3, 1), 99)], ) output_data = journal.as_generic() assert output_data[11] == "0" assert output_data[12] == "99"
def test_counter_journal(): journal = report.CounterJournal() assert journal.issn == u""
def test_counter_journal(self): journal = report.CounterJournal() self.assertEqual(journal.issn, "")