" " #39

Merged
JustinZeus merged 1 commit from mypi-fix into main 2026-03-01 23:12:26 +01:00
2 changed files with 10 additions and 3 deletions

View file

@ -10,7 +10,11 @@ from app.db.models import ScholarProfile
from app.services.scholar.parser import ScholarParserError, parse_profile_page from app.services.scholar.parser import ScholarParserError, parse_profile_page
from app.services.scholar.source import ScholarSource from app.services.scholar.source import ScholarSource
from app.services.scholars.author_search import search_author_candidates from app.services.scholars.author_search import search_author_candidates
from app.services.scholars.constants import ALLOWED_IMAGE_UPLOAD_CONTENT_TYPES from app.services.scholars.constants import (
ALLOWED_IMAGE_UPLOAD_CONTENT_TYPES,
SEARCH_COOLDOWN_REASON,
SEARCH_DISABLED_REASON,
)
from app.services.scholars.exceptions import ScholarServiceError from app.services.scholars.exceptions import ScholarServiceError
from app.services.scholars.uploads import ( from app.services.scholars.uploads import (
_ensure_upload_root, _ensure_upload_root,
@ -24,6 +28,8 @@ from app.services.scholars.validators import (
) )
__all__ = [ __all__ = [
"SEARCH_COOLDOWN_REASON",
"SEARCH_DISABLED_REASON",
"ScholarServiceError", "ScholarServiceError",
"clear_profile_image_customization", "clear_profile_image_customization",
"create_scholar_for_user", "create_scholar_for_user",

View file

@ -346,6 +346,7 @@ async def test_partial_discovery_exception_keeps_new_pub_count_consistent(
) )
db_session.add_all([run, publication]) db_session.add_all([run, publication])
await db_session.commit() await db_session.commit()
run_id = int(run.id)
call_count = 0 call_count = 0
@ -397,7 +398,7 @@ async def test_partial_discovery_exception_keeps_new_pub_count_consistent(
publications=publications, publications=publications,
) )
refreshed_run = await db_session.get(CrawlRun, int(run.id)) refreshed_run = await db_session.get(CrawlRun, run_id)
assert refreshed_run is not None assert refreshed_run is not None
assert int(refreshed_run.new_pub_count) == 1 assert int(refreshed_run.new_pub_count) == 1
link_count_result = await db_session.execute( link_count_result = await db_session.execute(
@ -409,7 +410,7 @@ async def test_partial_discovery_exception_keeps_new_pub_count_consistent(
AND first_seen_run_id = :run_id AND first_seen_run_id = :run_id
""" """
), ),
{"scholar_profile_id": scholar_profile_id, "run_id": int(run.id)}, {"scholar_profile_id": scholar_profile_id, "run_id": run_id},
) )
assert int(link_count_result.scalar_one()) == 1 assert int(link_count_result.scalar_one()) == 1