Unify concept of absolute_id and remote_id

This commit is contained in:
Mouse Reeve
2020-05-12 18:56:28 -07:00
parent 93493fc8e4
commit e76f96eb6c
33 changed files with 263 additions and 236 deletions

View File

@ -7,25 +7,19 @@ from fedireads.settings import DOMAIN
class BaseModel(TestCase):
def test_absolute_id(self):
def test_remote_id(self):
instance = FedireadsModel()
instance.id = 1
expected = instance.absolute_id
expected = instance.get_remote_id()
self.assertEqual(expected, 'https://%s/fedireadsmodel/1' % DOMAIN)
def test_absolute_id_with_remote(self):
instance = FedireadsModel()
instance.remote_id = 'boop doop'
expected = instance.absolute_id
self.assertEqual(expected, 'boop doop')
def test_absolute_id_with_user(self):
def test_remote_id_with_user(self):
user = models.User.objects.create_user(
'mouse', 'mouse@mouse.com', 'mouseword')
instance = FedireadsModel()
instance.user = user
instance.id = 1
expected = instance.absolute_id
expected = instance.get_remote_id()
self.assertEqual(
expected,
'https://%s/user/mouse/fedireadsmodel/1' % DOMAIN)