diff --git a/core/tests.py b/core/tests.py index fef91f02..94c0742d 100755 --- a/core/tests.py +++ b/core/tests.py @@ -40,8 +40,8 @@ class BookLoaderTests(TestCase): # edition edition = bookloader.add_by_isbn('0441007465') self.assertEqual(edition.title, 'Neuromancer') - self.assertEqual(edition.publication_date, u'2000-07-01') - self.assertEqual(edition.publisher, u'Ace Trade') + self.assertEqual(edition.publication_date, u'2000') + self.assertEqual(edition.publisher, u'Penguin') self.assertEqual(edition.isbn_10, '0441007465') self.assertEqual(edition.isbn_13, '9780441007462') self.assertEqual(edition.googlebooks_id, 'IDFfMPW32hQC') @@ -64,8 +64,8 @@ class BookLoaderTests(TestCase): self.assertEqual(edition.work.publishers().count(), 1) old_pub_name.publisher = pub old_pub_name.save() - edition.set_publisher(u'Ace Trade') - self.assertEqual(edition.publisher, u'test publisher name') # Ace Trade has been aliased + edition.set_publisher(u'Penguin') + self.assertEqual(edition.publisher, u'test publisher name') # Penguin has been aliased # locale in language edition = bookloader.add_by_isbn('9787500676911') self.assertEqual(edition.work.language, 'zh') @@ -674,7 +674,7 @@ class DownloadPageTest(TestCase): anon_client = Client() response = anon_client.get("/work/%s/download/" % w.id, follow=True) - self.assertContains(response, "/download_ebook/%s/"% eb1.id, count=4) #the extra is readmill + self.assertContains(response, "/download_ebook/%s/"% eb1.id, count=3) # no extra now, readmill not for google books? self.assertContains(response, "/download_ebook/%s/"% eb2.id, count=3) diff --git a/frontend/views.py b/frontend/views.py index 5b17acfc..cf5572bd 100755 --- a/frontend/views.py +++ b/frontend/views.py @@ -2353,7 +2353,8 @@ def download(request, work_id): other_ebooks = work.ebooks().filter(edition__unglued=False) try: readmill_epub_ebook = work.ebooks().filter(format='epub').exclude(provider='Google Books')[0] - readmill_epub_url = settings.BASE_URL_SECURE + reverse('download_ebook',args=[readmill_epub_ebook.id]) + #readmill_epub_url = settings.BASE_URL_SECURE + reverse('download_ebook',args=[readmill_epub_ebook.id]) + readmill_epub_url = readmill_epub_ebook.url except: readmill_epub_url = None