mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-24 17:10:31 +00:00
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")
|
@patch("bookwyrm.activitystreams.add_book_statuses_task.delay")
|
||||||
def test_annual_summary_page(self, *_):
|
def test_annual_summary_page(self, *_):
|
||||||
"""there are so many views, this just makes sure it LOADS"""
|
"""there are so many views, this just makes sure it LOADS"""
|
||||||
|
models.ReadThrough.objects.create(
|
||||||
shelf = self.local_user.shelf_set.filter(identifier="read").first()
|
|
||||||
models.ShelfBook.objects.create(
|
|
||||||
book=self.book,
|
|
||||||
user=self.local_user,
|
user=self.local_user,
|
||||||
shelf=shelf,
|
book=self.book,
|
||||||
shelved_date=make_date(2020, 1, 1),
|
finish_date=make_date(2020, 1, 1)
|
||||||
)
|
)
|
||||||
|
|
||||||
view = views.AnnualSummary.as_view()
|
view = views.AnnualSummary.as_view()
|
||||||
|
@ -132,12 +129,10 @@ class AnnualSummary(TestCase):
|
||||||
book=self.book,
|
book=self.book,
|
||||||
)
|
)
|
||||||
|
|
||||||
shelf = self.local_user.shelf_set.filter(identifier="read").first()
|
models.ReadThrough.objects.create(
|
||||||
models.ShelfBook.objects.create(
|
|
||||||
book=self.book,
|
|
||||||
user=self.local_user,
|
user=self.local_user,
|
||||||
shelf=shelf,
|
book=self.book,
|
||||||
shelved_date=make_date(2020, 1, 1),
|
finish_date=make_date(2020, 1, 1)
|
||||||
)
|
)
|
||||||
|
|
||||||
view = views.AnnualSummary.as_view()
|
view = views.AnnualSummary.as_view()
|
||||||
|
|
|
@ -189,7 +189,7 @@ def is_year_available(user, year):
|
||||||
Min("finish_date")
|
Min("finish_date")
|
||||||
)["finish_date__min"]
|
)["finish_date__min"]
|
||||||
if not earliest_year:
|
if not earliest_year:
|
||||||
return False
|
return True
|
||||||
earliest_year = earliest_year.year
|
earliest_year = earliest_year.year
|
||||||
today = date.today()
|
today = date.today()
|
||||||
year = int(year)
|
year = int(year)
|
||||||
|
|
Loading…
Reference in a new issue