mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-28 04:21:07 +00:00
Fixes outgoing tests
This commit is contained in:
parent
e6105c6cb0
commit
fcce1a5a36
1 changed files with 4 additions and 5 deletions
|
@ -33,9 +33,11 @@ class Outgoing(TestCase):
|
||||||
self.userdata = json.loads(datafile.read_bytes())
|
self.userdata = json.loads(datafile.read_bytes())
|
||||||
del self.userdata['icon']
|
del self.userdata['icon']
|
||||||
|
|
||||||
|
work = models.Work.objects.create(title='Test Work')
|
||||||
self.book = models.Edition.objects.create(
|
self.book = models.Edition.objects.create(
|
||||||
title='Example Edition',
|
title='Example Edition',
|
||||||
remote_id='https://example.com/book/1',
|
remote_id='https://example.com/book/1',
|
||||||
|
parent_work=work
|
||||||
)
|
)
|
||||||
self.shelf = models.Shelf.objects.create(
|
self.shelf = models.Shelf.objects.create(
|
||||||
name='Test Shelf',
|
name='Test Shelf',
|
||||||
|
@ -107,14 +109,11 @@ class Outgoing(TestCase):
|
||||||
|
|
||||||
def test_existing_user(self):
|
def test_existing_user(self):
|
||||||
''' simple database lookup by username '''
|
''' simple database lookup by username '''
|
||||||
user = models.User.objects.create_user(
|
|
||||||
'mouse', 'mouse@mouse.mouse', 'mouseword', local=True)
|
|
||||||
|
|
||||||
result = outgoing.handle_remote_webfinger('@mouse@%s' % DOMAIN)
|
result = outgoing.handle_remote_webfinger('@mouse@%s' % DOMAIN)
|
||||||
self.assertEqual(result, user)
|
self.assertEqual(result, self.local_user)
|
||||||
|
|
||||||
result = outgoing.handle_remote_webfinger('mouse@%s' % DOMAIN)
|
result = outgoing.handle_remote_webfinger('mouse@%s' % DOMAIN)
|
||||||
self.assertEqual(result, user)
|
self.assertEqual(result, self.local_user)
|
||||||
|
|
||||||
|
|
||||||
@responses.activate
|
@responses.activate
|
||||||
|
|
Loading…
Reference in a new issue