[mastodon] Fix tests
This commit is contained in:
parent
dfd17aa27c
commit
a61c48e99e
|
@ -26,7 +26,7 @@ class MastodonBot(Censor):
|
||||||
@classmethod
|
@classmethod
|
||||||
async def destroy_hood(cls, hood):
|
async def destroy_hood(cls, hood):
|
||||||
"""Removes all its database entries."""
|
"""Removes all its database entries."""
|
||||||
for mastodon in await Mastodon.objects.filter(hood=hood).all():
|
for mastodon in await MastodonAccount.objects.filter(hood=hood).all():
|
||||||
await mastodon.delete()
|
await mastodon.delete()
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
|
|
|
@ -14,7 +14,7 @@ from kibicara.platforms.mastodon.bot import spawner
|
||||||
from kibicara.platforms.mastodon.model import MastodonAccount, MastodonInstance
|
from kibicara.platforms.mastodon.model import MastodonAccount, MastodonInstance
|
||||||
from kibicara.webapi.hoods import get_hood, get_hood_unauthorized
|
from kibicara.webapi.hoods import get_hood, get_hood_unauthorized
|
||||||
|
|
||||||
from mastodon import Mastodon, MastodonError, MastodonNetworkError
|
from mastodon import Mastodon, MastodonNetworkError
|
||||||
from mastodon.errors import MastodonIllegalArgumentError
|
from mastodon.errors import MastodonIllegalArgumentError
|
||||||
|
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
@ -173,7 +173,7 @@ async def mastodon_create(values: BodyMastodonAccount, hood=Depends(get_hood)):
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
access_token = await get_event_loop().run_in_executor(
|
access_token = await get_event_loop().run_in_executor(
|
||||||
None, account.log_in, username, password
|
None, account.log_in, values.email, values.password
|
||||||
)
|
)
|
||||||
logger.debug(f"{access_token}")
|
logger.debug(f"{access_token}")
|
||||||
mastodon = await MastodonAccount.objects.create(
|
mastodon = await MastodonAccount.objects.create(
|
||||||
|
|
Loading…
Reference in a new issue