Trilby tests: rename url to remote_url, per policy.

Also add @httpretty.activate where needed.
status-serialisers
Marnanel Thurman 2020-10-19 16:49:27 +01:00
rodzic 5d6c209fde
commit f480aa71d0
3 zmienionych plików z 9 dodań i 7 usunięć

Wyświetl plik

@ -37,17 +37,17 @@ class TestPerson(TrilbyTestCase):
carol = create_local_person(name='carol') carol = create_local_person(name='carol')
peter = create_remote_person( peter = create_remote_person(
url = "https://example.com/users/peter", remote_url = "https://example.com/users/peter",
name = "peter", name = "peter",
auto_fetch = True, auto_fetch = True,
) )
quentin = create_remote_person( quentin = create_remote_person(
url = "https://example.com/users/quentin", remote_url = "https://example.com/users/quentin",
name = "quentin", name = "quentin",
auto_fetch = True, auto_fetch = True,
) )
roger = create_remote_person( roger = create_remote_person(
url = "https://example.com/users/roger", remote_url = "https://example.com/users/roger",
name = "roger", name = "roger",
auto_fetch = True, auto_fetch = True,
) )
@ -69,7 +69,7 @@ class TestPerson(TrilbyTestCase):
) )
mock_remote_object( mock_remote_object(
url="https://example.com/users/peter/followers", remote_url="https://example.com/users/peter/followers",
content=REMOTE_FOLLOWERS_COLLECTION, content=REMOTE_FOLLOWERS_COLLECTION,
) )

Wyświetl plik

@ -6,6 +6,7 @@ from kepi.trilby_api.models import *
from kepi.bowler_pub.tests import create_remote_person from kepi.bowler_pub.tests import create_remote_person
from kepi.bowler_pub.utils import uri_to_url from kepi.bowler_pub.utils import uri_to_url
from django.conf import settings from django.conf import settings
import httpretty
# Tests for statuses. API docs are here: # Tests for statuses. API docs are here:
# https://docs.joinmastodon.org/methods/statuses/ # https://docs.joinmastodon.org/methods/statuses/
@ -660,6 +661,7 @@ class TestGetStatus(TrilbyTestCase):
'Not found.', 'Not found.',
) )
@httpretty.activate
def test_is_local(self): def test_is_local(self):
self._alice = create_local_person(name='alice') self._alice = create_local_person(name='alice')
@ -673,7 +675,7 @@ class TestGetStatus(TrilbyTestCase):
) )
self._bob = create_remote_person( self._bob = create_remote_person(
url = "https://example.org/people/bob", remote_url = "https://example.org/people/bob",
name='bob', name='bob',
auto_fetch = True, auto_fetch = True,
) )

Wyświetl plik

@ -29,7 +29,7 @@ class Tests(django.test.TestCase):
self.alice = create_local_person("alice") self.alice = create_local_person("alice")
self.bob = create_remote_person( self.bob = create_remote_person(
url = 'https://example.org/people/bob', remote_url = 'https://example.org/people/bob',
name = 'bob', name = 'bob',
auto_fetch = True, auto_fetch = True,
) )
@ -40,7 +40,7 @@ class Tests(django.test.TestCase):
self.seen_message = True self.seen_message = True
mock_remote_object( mock_remote_object(
url = 'https://example.org/people/bob/inbox', remote_url = 'https://example.org/people/bob/inbox',
content = 'Thank you', content = 'Thank you',
status = 200, status = 200,
as_post = True, as_post = True,