mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-18 11:46:23 -07:00
Make pre-migration /test/ have board id 3, make sure no deleted threads were migrated
This commit is contained in:
parent
95460e91d6
commit
7cddc3e43e
3 changed files with 8 additions and 1 deletions
|
@ -34,7 +34,7 @@ func TestMigrateBoardsToNewDB(t *testing.T) {
|
|||
t.FailNow()
|
||||
}
|
||||
|
||||
assert.Equal(t, len(migratedBoards), 2, "Expected updated boards list to have two boards")
|
||||
assert.Equal(t, len(migratedBoards), 3, "Expected updated boards list to have three boards")
|
||||
assert.Equal(t, len(migratedSections), 2, "Expected updated sections list to have two sections")
|
||||
|
||||
// Test migrated sections
|
||||
|
@ -49,8 +49,10 @@ func TestMigrateBoardsToNewDB(t *testing.T) {
|
|||
if !assert.NoError(t, err) {
|
||||
t.FailNow()
|
||||
}
|
||||
assert.Equal(t, 1, testBoard.ID)
|
||||
assert.Equal(t, "Testing Board", testBoard.Title)
|
||||
assert.Equal(t, "Board for testing pre-2021 migration", testBoard.Subtitle)
|
||||
assert.Equal(t, "Board for testing pre-2021 migration description", testBoard.Description)
|
||||
testBoardSection, err := gcsql.GetSectionFromID(testBoard.SectionID)
|
||||
if !assert.NoError(t, err) {
|
||||
t.FailNow()
|
||||
|
|
|
@ -39,4 +39,9 @@ func TestMigratePostsToNewDB(t *testing.T) {
|
|||
t.FailNow()
|
||||
}
|
||||
assert.True(t, locked, "Expected thread ID 1 to be locked")
|
||||
|
||||
// make sure deleted posts and threads weren't migrated
|
||||
var numDeleted int
|
||||
assert.NoError(t, gcsql.QueryRowSQL("SELECT COUNT(*) FROM DBPREFIXposts WHERE message_raw LIKE '%deleted%' OR is_deleted", nil, []any{&numDeleted}))
|
||||
assert.Zero(t, numDeleted, "Expected no deleted threads to be migrated")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue