'/api/filter-books/?lektura=true',
[])
- self.assert_slugs(
- '/api/filter-books/?preview=true',
- ['grandchild'])
+ Book.objects.filter(slug='grandchild').update(preview=True)
+ # Skipping: we don't allow previewed books in filtered list.
+ #self.assert_slugs(
+ # '/api/filter-books/?preview=true',
+ # ['grandchild'])
self.assert_slugs(
'/api/filter-books/?preview=false',
['child', 'parent'])
+ Book.objects.filter(slug='grandchild').update(preview=False)
self.assert_slugs(
'/api/filter-books/?audiobook=true',
self.assertEqual(self.load_json('/api/blog'), [])
-class PreviewTests(ApiTest):
- def unauth(self):
- self.assert_json_response('/api/preview/', 'preview.json')
-
-
class OAuth1Tests(ApiTest):
@classmethod
def setUpClass(cls):
['parent'])
def test_subscription(self):
+ Book.objects.filter(slug='grandchild').update(preview=True)
+
self.assert_slugs('/api/preview/', ['grandchild'])
self.assertEqual(
self.signed_json('/api/username/'),
self.signed('/api/epub/grandchild/').content,
b"<epub>")
+ Book.objects.filter(slug='grandchild').update(preview=False)
+
def test_publish(self):
response = self.signed('/api/books/',
method='POST',