forked from mirrors/bookwyrm
Updates tests
This commit is contained in:
parent
6ca57ae314
commit
f9e9dc55d5
2 changed files with 7 additions and 12 deletions
|
@ -100,13 +100,10 @@ class AnnualSummary(TestCase):
|
|||
@patch("bookwyrm.activitystreams.add_book_statuses_task.delay")
|
||||
def test_annual_summary_page(self, *_):
|
||||
"""there are so many views, this just makes sure it LOADS"""
|
||||
|
||||
shelf = self.local_user.shelf_set.filter(identifier="read").first()
|
||||
models.ShelfBook.objects.create(
|
||||
book=self.book,
|
||||
models.ReadThrough.objects.create(
|
||||
user=self.local_user,
|
||||
shelf=shelf,
|
||||
shelved_date=make_date(2020, 1, 1),
|
||||
book=self.book,
|
||||
finish_date=make_date(2020, 1, 1)
|
||||
)
|
||||
|
||||
view = views.AnnualSummary.as_view()
|
||||
|
@ -132,12 +129,10 @@ class AnnualSummary(TestCase):
|
|||
book=self.book,
|
||||
)
|
||||
|
||||
shelf = self.local_user.shelf_set.filter(identifier="read").first()
|
||||
models.ShelfBook.objects.create(
|
||||
book=self.book,
|
||||
models.ReadThrough.objects.create(
|
||||
user=self.local_user,
|
||||
shelf=shelf,
|
||||
shelved_date=make_date(2020, 1, 1),
|
||||
book=self.book,
|
||||
finish_date=make_date(2020, 1, 1)
|
||||
)
|
||||
|
||||
view = views.AnnualSummary.as_view()
|
||||
|
|
|
@ -189,7 +189,7 @@ def is_year_available(user, year):
|
|||
Min("finish_date")
|
||||
)["finish_date__min"]
|
||||
if not earliest_year:
|
||||
return False
|
||||
return True
|
||||
earliest_year = earliest_year.year
|
||||
today = date.today()
|
||||
year = int(year)
|
||||
|
|
Loading…
Reference in a new issue