Loading opds_catalog/__pycache__/feeds.cpython-35.pyc −2 B (16.3 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/feeds.py +2 −2 Original line number Diff line number Diff line Loading @@ -227,8 +227,8 @@ class SearchBooksFeed(Feed): # TODO: Переделать на поиск авторов books = Book.objects.filter(authors__last_name__contains=searchterms) elif searchtype == 'genres': # TODO: Переделать на поиск жанров books = Book.objects.filter(genres__section__contains=searchterms) # TODO: Переделать на поиск жанров (genre нужно заменить на section нужно скорее всего) books = Book.objects.filter(genres__genre__contains=searchterms) else: books = Book.objects.filter(title__contains=searchterms) Loading opds_catalog/tests/__pycache__/test_feeds.cpython-35.pyc +597 B (3.37 KiB) File changed.No diff preview for this file type. View original file View changed file opds_catalog/tests/test_feeds.py +18 −3 Original line number Diff line number Diff line Loading @@ -48,10 +48,25 @@ class ModelsTestCase(TestCase): self.assertEquals(response.status_code, 200) self.assertIn('www.sopds.ru', response.content.decode()) def test_SearchTypes(self): def test_SearchTerms(self): c = Client() response = c.get('/opds/search/') response = c.get('/opds/search/Драк/') self.assertEquals(response.status_code, 200) self.assertIn('www.sopds.ru', response.content.decode()) self.assertIn(_("Search by titles"), response.content.decode()) response = c.get('/opds/search/titles/Драк/') self.assertEquals(response.status_code, 200) self.assertIn("Драконьи Услуги", response.content.decode()) self.assertIn("Куприянов Денис", response.content.decode()) response = c.get('/opds/search/authors/Логинов/') self.assertEquals(response.status_code, 200) self.assertIn("Любовь в жизни Обломова", response.content.decode()) self.assertIn("Логинов Святослав", response.content.decode()) response = c.get('/opds/search/genres/antiq/') self.assertEquals(response.status_code, 200) self.assertIn("The Sanctuary Sparrow", response.content.decode()) self.assertIn("Peters Ellis", response.content.decode()) No newline at end of file Loading
opds_catalog/__pycache__/feeds.cpython-35.pyc −2 B (16.3 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/feeds.py +2 −2 Original line number Diff line number Diff line Loading @@ -227,8 +227,8 @@ class SearchBooksFeed(Feed): # TODO: Переделать на поиск авторов books = Book.objects.filter(authors__last_name__contains=searchterms) elif searchtype == 'genres': # TODO: Переделать на поиск жанров books = Book.objects.filter(genres__section__contains=searchterms) # TODO: Переделать на поиск жанров (genre нужно заменить на section нужно скорее всего) books = Book.objects.filter(genres__genre__contains=searchterms) else: books = Book.objects.filter(title__contains=searchterms) Loading
opds_catalog/tests/__pycache__/test_feeds.cpython-35.pyc +597 B (3.37 KiB) File changed.No diff preview for this file type. View original file View changed file
opds_catalog/tests/test_feeds.py +18 −3 Original line number Diff line number Diff line Loading @@ -48,10 +48,25 @@ class ModelsTestCase(TestCase): self.assertEquals(response.status_code, 200) self.assertIn('www.sopds.ru', response.content.decode()) def test_SearchTypes(self): def test_SearchTerms(self): c = Client() response = c.get('/opds/search/') response = c.get('/opds/search/Драк/') self.assertEquals(response.status_code, 200) self.assertIn('www.sopds.ru', response.content.decode()) self.assertIn(_("Search by titles"), response.content.decode()) response = c.get('/opds/search/titles/Драк/') self.assertEquals(response.status_code, 200) self.assertIn("Драконьи Услуги", response.content.decode()) self.assertIn("Куприянов Денис", response.content.decode()) response = c.get('/opds/search/authors/Логинов/') self.assertEquals(response.status_code, 200) self.assertIn("Любовь в жизни Обломова", response.content.decode()) self.assertIn("Логинов Святослав", response.content.decode()) response = c.get('/opds/search/genres/antiq/') self.assertEquals(response.status_code, 200) self.assertIn("The Sanctuary Sparrow", response.content.decode()) self.assertIn("Peters Ellis", response.content.decode()) No newline at end of file