Skip to content

Commit

Permalink
annual-reports: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drjova committed Oct 30, 2023
1 parent 7d0449c commit ac796c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions annual-reports/tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import datetime

import pytest
from api import AnnualReportsAPI
from models import Categories, Journals, Publications
Expand Down Expand Up @@ -32,7 +34,7 @@ def test_publications(self):
assert publications[0].contributions_to_conference_proceedings == 1118
assert publications[0].reports_books_and_book_chapters == 26
assert publications[0].theses == 275
assert publications[0].year == 2022
assert publications[0].year == datetime.date(2022, 1, 1)

with Session(self.annual_reports.engine) as session:
session.query(Publications).delete()
Expand Down Expand Up @@ -74,7 +76,7 @@ def test_categories(self):
for category in categories:
assert category.category in expected
assert category.count == expected[category.category]
assert category.year == 2022
assert category.year == datetime.date(2022, 1, 1)

with Session(self.annual_reports.engine) as session:
session.query(Categories).delete()
Expand Down Expand Up @@ -215,7 +217,7 @@ def test_journals(self):
for journal in journals:
assert journal.journal in expected
assert journal.count == expected[journal.journal]
assert journal.year == 2022
assert journal.year == datetime.date(2022, 1, 1)

with Session(self.annual_reports.engine) as session:
session.query(Journals).delete()
Expand Down

0 comments on commit ac796c2

Please sign in to comment.