2020-05-10 02:48:30 +00:00
|
|
|
from django.test import TestCase
|
2020-09-17 20:02:52 +00:00
|
|
|
import json
|
|
|
|
import pathlib
|
2020-05-10 02:48:30 +00:00
|
|
|
|
2020-09-21 15:10:37 +00:00
|
|
|
from bookwyrm import activitypub, models
|
|
|
|
from bookwyrm import status as status_builder
|
2020-05-10 02:48:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Quotation(TestCase):
|
|
|
|
''' we have hecka ways to create statuses '''
|
|
|
|
def setUp(self):
|
|
|
|
self.user = models.User.objects.create_user(
|
2020-09-17 20:02:52 +00:00
|
|
|
'mouse', 'mouse@mouse.mouse', 'mouseword',
|
|
|
|
remote_id='https://example.com/user/mouse'
|
|
|
|
)
|
|
|
|
self.book = models.Edition.objects.create(
|
|
|
|
title='Example Edition',
|
|
|
|
remote_id='https://example.com/book/1',
|
|
|
|
)
|
2020-05-10 02:48:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_create_quotation(self):
|
|
|
|
quotation = status_builder.create_quotation(
|
|
|
|
self.user, self.book, 'commentary', 'a quote')
|
|
|
|
self.assertEqual(quotation.quote, 'a quote')
|
|
|
|
self.assertEqual(quotation.content, 'commentary')
|