+ def test_books(self):
+ self.assert_json_response('/api/books/', 'books.json')
+ self.assert_json_response('/api/books/?new_api=true', 'books.json')
+
+ self.assert_slugs('/api/audiobooks/', ['parent'])
+ self.assert_slugs('/api/daisy/', ['parent'])
+ self.assert_slugs('/api/newest/', ['parent'])
+ self.assert_slugs('/api/parent_books/', ['parent'])
+ self.assert_slugs('/api/recommended/', ['parent'])
+
+ # Book paging.
+ self.assert_slugs('/api/books/after/grandchild/count/1/', ['parent'])
+ self.assert_slugs('/api/books/?new_api=true&after=$grandchild$3&count=1', ['parent'])
+
+ # By tag.
+ self.assert_slugs('/api/authors/john-doe/books/', ['parent'])
+ self.assert_slugs('/api/genres/sonet/books/?authors=john-doe', ['parent'])
+ # It is probably a mistake that this doesn't filter:
+ self.assert_slugs('/api/books/?authors=john-doe', ['child', 'grandchild', 'parent'])
+
+ # Parent books by tag.
+ # Notice this contains a grandchild, if a child doesn't have the tag.
+ # This probably isn't really intended behavior and should be redefined.
+ self.assert_slugs('/api/genres/sonet/parent_books/', ['grandchild', 'parent'])
+
+ def test_ebooks(self):