[mastodon] Fix tests

This commit is contained in:
missytake 2023-03-19 12:39:41 +01:00
parent dfd17aa27c
commit a61c48e99e
2 changed files with 3 additions and 3 deletions

View file

@ -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):

View file

@ -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(