mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 17:41:08 +00:00
improve formatting
This commit is contained in:
parent
93c6b76dab
commit
1608ca6401
2 changed files with 22 additions and 21 deletions
|
@ -1,5 +1,4 @@
|
||||||
"""Import data from Bookwyrm export files"""
|
"""Import data from Bookwyrm export files"""
|
||||||
from typing import Any
|
|
||||||
from django.http import QueryDict
|
from django.http import QueryDict
|
||||||
|
|
||||||
from bookwyrm.models import User
|
from bookwyrm.models import User
|
||||||
|
|
|
@ -66,27 +66,29 @@ class BookwyrmBooksImport(TestCase):
|
||||||
self.assertEqual(import_items[2].index, 2)
|
self.assertEqual(import_items[2].index, 2)
|
||||||
self.assertEqual(import_items[2].shelf_name, "Cooking")
|
self.assertEqual(import_items[2].shelf_name, "Cooking")
|
||||||
|
|
||||||
# def test_create_retry_job(self, *_):
|
def test_create_retry_job(self, *_):
|
||||||
# """trying again with items that didn't import"""
|
"""trying again with items that didn't import"""
|
||||||
# import_job = self.importer.create_job(
|
import_job = self.importer.create_job(
|
||||||
# self.local_user, self.csv, False, "unlisted"
|
self.local_user, self.csv, False, "unlisted"
|
||||||
# )
|
)
|
||||||
# import_items = models.ImportItem.objects.filter(job=import_job).all()[:2]
|
import_items = models.ImportItem.objects.filter(job=import_job).all()[:2]
|
||||||
|
|
||||||
# retry = self.importer.create_retry_job(
|
retry = self.importer.create_retry_job(
|
||||||
# self.local_user, import_job, import_items
|
self.local_user, import_job, import_items
|
||||||
# )
|
)
|
||||||
# self.assertNotEqual(import_job, retry)
|
self.assertNotEqual(import_job, retry)
|
||||||
# self.assertEqual(retry.user, self.local_user)
|
self.assertEqual(retry.user, self.local_user)
|
||||||
# self.assertEqual(retry.include_reviews, False)
|
self.assertEqual(retry.include_reviews, False)
|
||||||
# self.assertEqual(retry.privacy, "unlisted")
|
self.assertEqual(retry.privacy, "unlisted")
|
||||||
|
|
||||||
# retry_items = models.ImportItem.objects.filter(job=retry).all()
|
retry_items = models.ImportItem.objects.filter(job=retry).all()
|
||||||
# self.assertEqual(len(retry_items), 2)
|
self.assertEqual(len(retry_items), 2)
|
||||||
# self.assertEqual(retry_items[0].index, 0)
|
self.assertEqual(retry_items[0].index, 0)
|
||||||
# self.assertEqual(retry_items[0].data["title"], "Gideon the Ninth (The Locked Tomb #1)")
|
self.assertEqual(
|
||||||
# self.assertEqual(retry_items[1].index, 1)
|
retry_items[0].data["title"], "Gideon the Ninth (The Locked Tomb #1)"
|
||||||
# self.assertEqual(retry_items[1].data["author_text"], "Aaron A. Reed")
|
)
|
||||||
|
self.assertEqual(retry_items[1].index, 1)
|
||||||
|
self.assertEqual(retry_items[1].data["author_text"], "Aaron A. Reed")
|
||||||
|
|
||||||
def test_handle_imported_book(self, *_):
|
def test_handle_imported_book(self, *_):
|
||||||
"""import added a book, this adds related connections"""
|
"""import added a book, this adds related connections"""
|
||||||
|
|
Loading…
Reference in a new issue