2020-05-10 02:22:41 +00:00
|
|
|
from django.test import TestCase
|
|
|
|
|
2020-09-21 15:10:37 +00:00
|
|
|
from bookwyrm import models
|
|
|
|
from bookwyrm import status as status_builder
|
2020-05-10 02:22:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Status(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',
|
|
|
|
local=False,
|
|
|
|
inbox='https://example.com/user/mouse/inbox',
|
|
|
|
outbox='https://example.com/user/mouse/outbox',
|
|
|
|
remote_id='https://example.com/user/mouse'
|
|
|
|
)
|
2020-05-10 02:22:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_create_status(self):
|
|
|
|
content = 'statuses are usually <i>replies</i>'
|
|
|
|
status = status_builder.create_status(
|
|
|
|
self.user, content)
|
|
|
|
self.assertEqual(status.content, content)
|
|
|
|
|
|
|
|
reply = status_builder.create_status(
|
|
|
|
self.user, content, reply_parent=status)
|
|
|
|
self.assertEqual(reply.content, content)
|
|
|
|
self.assertEqual(reply.reply_parent, status)
|