@@ -368,15 +368,8 @@ func TestDiaryEntry_RegenerateAllEmbeddings_SemanticEnabled(t *testing.T) {
368368 userID := testutil .CreateTestUser (t , db , "regen-embedding@example.com" , "Regen Test User" )
369369 ctx := createAuthenticatedContext (userID )
370370
371- // semantic_search_enabled=trueでuser_llmsを直接挿入
372- now := time .Now ().Unix ()
373- if _ , err := db .ExecContext (ctx ,
374- `INSERT INTO user_llms (user_id, llm_provider, key, auto_summary_daily, auto_summary_monthly, auto_latest_trend_enabled, semantic_search_enabled, created_at, updated_at)
375- VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)` ,
376- userID , 1 , "test-api-key" , false , false , false , true , now , now ,
377- ); err != nil {
378- t .Fatalf ("user_llmsの挿入に失敗: %v" , err )
379- }
371+ // semantic_search_enabled=trueでuser_llmsを挿入
372+ testutil .CreateTestUserLLMWithSettings (t , db , userID , "test-api-key" , false , false , false , true )
380373
381374 redisClient := setupTestRedisForDiary (t )
382375 svc := & DiaryEntry {DB : db , Redis : redisClient }
@@ -401,14 +394,7 @@ func TestDiaryEntry_SearchDiaryEntriesSemantic_EnrichedQuery(t *testing.T) {
401394 ctx := createAuthenticatedContext (userID )
402395
403396 // semantic_search_enabled=trueでuser_llmsを挿入
404- now := time .Now ().Unix ()
405- if _ , err := db .ExecContext (ctx ,
406- `INSERT INTO user_llms (user_id, llm_provider, key, auto_summary_daily, auto_summary_monthly, auto_latest_trend_enabled, semantic_search_enabled, created_at, updated_at)
407- VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)` ,
408- userID , 1 , "test-api-key" , false , false , false , true , now , now ,
409- ); err != nil {
410- t .Fatalf ("user_llmsの挿入に失敗: %v" , err )
411- }
397+ testutil .CreateTestUserLLMWithSettings (t , db , userID , "test-api-key" , false , false , false , true )
412398
413399 embedder := & mockGeminiEmbedder {}
414400 svc := & DiaryEntry {
0 commit comments