More user serialization tests
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
''' testing models '''
|
||||
from unittest.mock import patch
|
||||
from django.test import TestCase
|
||||
|
||||
from bookwyrm import models
|
||||
@ -22,6 +23,13 @@ class User(TestCase):
|
||||
self.assertIsNotNone(self.user.key_pair.private_key)
|
||||
self.assertIsNotNone(self.user.key_pair.public_key)
|
||||
|
||||
def test_remote_user(self):
|
||||
with patch('bookwyrm.models.user.set_remote_server.delay'):
|
||||
user = models.User.objects.create_user(
|
||||
'rat', 'rat@rat.rat', 'ratword', local=False,
|
||||
remote_id='https://example.com/dfjkg')
|
||||
self.assertEqual(user.username, 'rat@example.com')
|
||||
|
||||
|
||||
def test_user_shelves(self):
|
||||
shelves = models.Shelf.objects.filter(user=self.user).all()
|
||||
|
Reference in New Issue
Block a user