From 4000ebde1f36f1df40d874319bdae3812c104748 Mon Sep 17 00:00:00 2001 From: thatandromeda Date: Fri, 17 Feb 2012 14:07:57 -0500 Subject: [PATCH 1/4] typo fix --- frontend/templates/work_list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/templates/work_list.html b/frontend/templates/work_list.html index 3d2ab330..8e58b499 100644 --- a/frontend/templates/work_list.html +++ b/frontend/templates/work_list.html @@ -27,7 +27,7 @@
{{ facet|capfirst }}
-
With your help we're raising money to buy the right to give these books to the world. +
With your help we're raising money to buy the rights to give these books to the world.
From 09681456b428c06d45e12eca36a2e4b9ab301db8 Mon Sep 17 00:00:00 2001 From: thatandromeda Date: Fri, 17 Feb 2012 14:08:23 -0500 Subject: [PATCH 2/4] typo fix --- frontend/templates/comments.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/templates/comments.html b/frontend/templates/comments.html index 99ee3873..3f72caa7 100644 --- a/frontend/templates/comments.html +++ b/frontend/templates/comments.html @@ -28,7 +28,7 @@ comments rss?
Latest Comments
-
With your help we're raising money to buy the right to give these books to the world. +
With your help we're raising money to buy the rights to give these books to the world.
From d14d0e1546471094c47f9d12fb2fe589398a5319 Mon Sep 17 00:00:00 2001 From: thatandromeda Date: Fri, 17 Feb 2012 14:08:40 -0500 Subject: [PATCH 3/4] typo fix --- frontend/templates/campaign_list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/templates/campaign_list.html b/frontend/templates/campaign_list.html index 81a18d2b..cf4a420e 100644 --- a/frontend/templates/campaign_list.html +++ b/frontend/templates/campaign_list.html @@ -25,7 +25,7 @@
{{ facet|capfirst }}
-
With your help we're raising money to buy the right to give these books to the world. +
With your help we're raising money to buy the rights to give these books to the world.
From 1751627ad6b64af7d0e874e4ce55346c7f902aa3 Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Tue, 21 Feb 2012 09:39:36 -0800 Subject: [PATCH 4/4] compare the url for the ebooks that come back on id and format alone --- core/tests.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/core/tests.py b/core/tests.py index 9d8c0768..6461e291 100755 --- a/core/tests.py +++ b/core/tests.py @@ -23,6 +23,7 @@ from celery.task import chord from time import sleep from math import factorial +from urlparse import parse_qs, urlparse class BookLoaderTests(TestCase): @@ -54,7 +55,7 @@ class BookLoaderTests(TestCase): e = models.Edition(title=w.title,work=w) e.save() models.Identifier(type='isbn', value='9780226032030', work=w, edition=e).save() - bookloader.update_edition(e) + bookloader.update_edition(e) self.assertEqual(e.work.language, 'en') self.assertEqual(e.title, 'Forbidden journeys') @@ -223,18 +224,22 @@ class BookLoaderTests(TestCase): #ebook_epub = edition.ebooks.all()[0] ebook_epub = edition.ebooks.filter(format='epub')[0] self.assertEqual(ebook_epub.format, 'epub') - self.assertEqual(ebook_epub.url, 'http://books.google.com/books/download/The_Latin_language.epub?id=U3FXAAAAYAAJ&ie=ISO-8859-1&output=epub&source=gbs_api') + #self.assertEqual(ebook_epub.url, 'http://books.google.com/books/download/The_Latin_language.epub?id=U3FXAAAAYAAJ&ie=ISO-8859-1&output=epub&source=gbs_api') + self.assertEqual(parse_qs(urlparse(ebook_epub.url).query).get("id"), ['U3FXAAAAYAAJ']) + self.assertEqual(parse_qs(urlparse(ebook_epub.url).query).get("output"), ['epub']) self.assertEqual(ebook_epub.provider, 'google') ebook_pdf = edition.ebooks.filter(format='pdf')[0] self.assertEqual(ebook_pdf.format, 'pdf') - self.assertEqual(ebook_pdf.url, 'http://books.google.com/books/download/The_Latin_language.pdf?id=U3FXAAAAYAAJ&ie=ISO-8859-1&output=pdf&sig=ACfU3U2yLt3nmTncB8ozxOWUc4iHKUznCA&source=gbs_api') + #self.assertEqual(ebook_pdf.url, 'http://books.google.com/books/download/The_Latin_language.pdf?id=U3FXAAAAYAAJ&ie=ISO-8859-1&output=pdf&sig=ACfU3U2yLt3nmTncB8ozxOWUc4iHKUznCA&source=gbs_api') + self.assertEqual(parse_qs(urlparse(ebook_pdf.url).query).get("id"), ['U3FXAAAAYAAJ']) + self.assertEqual(parse_qs(urlparse(ebook_pdf.url).query).get("output"), ['pdf']) self.assertEqual(ebook_pdf.provider, 'google') w = edition.work - self.assertEqual(w.first_epub().url, "http://books.google.com/books/download/The_Latin_language.epub?id=U3FXAAAAYAAJ&ie=ISO-8859-1&output=epub&source=gbs_api") - self.assertEqual(w.first_pdf().url, "http://books.google.com/books/download/The_Latin_language.pdf?id=U3FXAAAAYAAJ&ie=ISO-8859-1&output=pdf&sig=ACfU3U2yLt3nmTncB8ozxOWUc4iHKUznCA&source=gbs_api") - self.assertEqual(w.first_epub_url(), "http://books.google.com/books/download/The_Latin_language.epub?id=U3FXAAAAYAAJ&ie=ISO-8859-1&output=epub&source=gbs_api") - self.assertEqual(w.first_pdf_url(), "http://books.google.com/books/download/The_Latin_language.pdf?id=U3FXAAAAYAAJ&ie=ISO-8859-1&output=pdf&sig=ACfU3U2yLt3nmTncB8ozxOWUc4iHKUznCA&source=gbs_api") + self.assertEqual(w.first_epub().url, ebook_epub.url) + self.assertEqual(w.first_pdf().url, ebook_pdf.url) + self.assertEqual(w.first_epub_url(), ebook_epub.url) + self.assertEqual(w.first_pdf_url(), ebook_pdf.url) def test_add_no_ebook(self): # this edition lacks an ebook, but we should still be able to load it