mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 19:11:09 +00:00
Fix test_export
This commit is contained in:
parent
854eb36618
commit
ddbda3ab9c
1 changed files with 5 additions and 4 deletions
|
@ -56,11 +56,12 @@ class ExportViews(TestCase):
|
|||
|
||||
def test_export_file(self, *_):
|
||||
"""simple export"""
|
||||
models.ShelfBook.objects.create(
|
||||
shelfbook = models.ShelfBook.objects.create(
|
||||
shelf=self.local_user.shelf_set.first(),
|
||||
user=self.local_user,
|
||||
book=self.book,
|
||||
)
|
||||
book_date = str.encode(f"{shelfbook.shelved_date.date()}")
|
||||
request = self.factory.post("")
|
||||
request.user = self.local_user
|
||||
export = views.Export.as_view()(request)
|
||||
|
@ -69,7 +70,7 @@ class ExportViews(TestCase):
|
|||
# pylint: disable=line-too-long
|
||||
self.assertEqual(
|
||||
export.content,
|
||||
b"title,author_text,remote_id,openlibrary_key,inventaire_id,librarything_key,goodreads_key,bnf_id,viaf,wikidata,asin,aasin,isfdb,isbn_10,isbn_13,oclc_number,start_date,finish_date,stopped_date,rating,review_name,review_cw,review_content,review_published,shelf,shelf_name,shelf_date\r\nTest Book,,"
|
||||
+ self.book.remote_id.encode("utf-8")
|
||||
+ b",,,,,beep,,,,,,123456789X,9781234567890,,,,,,,,,,,,\r\n",
|
||||
b"title,author_text,remote_id,openlibrary_key,inventaire_id,librarything_key,goodreads_key,bnf_id,viaf,wikidata,asin,aasin,isfdb,isbn_10,isbn_13,oclc_number,start_date,finish_date,stopped_date,rating,review_name,review_cw,review_content,review_published,shelf,shelf_name,shelf_date\r\n"
|
||||
+ b"Test Book,,%b,,,,,beep,,,,,,123456789X,9781234567890,,,,,,,,,,to-read,To Read,%b\r\n"
|
||||
% (self.book.remote_id.encode("utf-8"), book_date),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue