mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 09:31:08 +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, *_):
|
def test_export_file(self, *_):
|
||||||
"""simple export"""
|
"""simple export"""
|
||||||
models.ShelfBook.objects.create(
|
shelfbook = models.ShelfBook.objects.create(
|
||||||
shelf=self.local_user.shelf_set.first(),
|
shelf=self.local_user.shelf_set.first(),
|
||||||
user=self.local_user,
|
user=self.local_user,
|
||||||
book=self.book,
|
book=self.book,
|
||||||
)
|
)
|
||||||
|
book_date = str.encode(f"{shelfbook.shelved_date.date()}")
|
||||||
request = self.factory.post("")
|
request = self.factory.post("")
|
||||||
request.user = self.local_user
|
request.user = self.local_user
|
||||||
export = views.Export.as_view()(request)
|
export = views.Export.as_view()(request)
|
||||||
|
@ -69,7 +70,7 @@ class ExportViews(TestCase):
|
||||||
# pylint: disable=line-too-long
|
# pylint: disable=line-too-long
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
export.content,
|
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,,"
|
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"
|
||||||
+ self.book.remote_id.encode("utf-8")
|
+ b"Test Book,,%b,,,,,beep,,,,,,123456789X,9781234567890,,,,,,,,,,to-read,To Read,%b\r\n"
|
||||||
+ b",,,,,beep,,,,,,123456789X,9781234567890,,,,,,,,,,,,\r\n",
|
% (self.book.remote_id.encode("utf-8"), book_date),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue