mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 12:52:27 -05:00
fixes + db changes (#204)
* fixes + db changes * make duration more lenient
This commit is contained in:
parent
446dbb7a72
commit
e681aac589
16 changed files with 401 additions and 78 deletions
|
|
@ -64,6 +64,40 @@ func (suite *BasicTestSuite) TestGetAllNotNull() {
|
|||
}
|
||||
}
|
||||
|
||||
func (suite *BasicTestSuite) TestUpdateOneByPrimaryKeySetEmpty() {
|
||||
testAccount := suite.testAccounts["local_account_1"]
|
||||
|
||||
// try removing the note from zork
|
||||
err := suite.db.UpdateOneByPrimaryKey(context.Background(), "note", "", testAccount)
|
||||
suite.NoError(err)
|
||||
|
||||
// get zork out of the database
|
||||
dbAccount, err := suite.db.GetAccountByID(context.Background(), testAccount.ID)
|
||||
suite.NoError(err)
|
||||
suite.NotNil(dbAccount)
|
||||
|
||||
// note should be empty now
|
||||
suite.Empty(dbAccount.Note)
|
||||
}
|
||||
|
||||
func (suite *BasicTestSuite) TestUpdateOneByPrimaryKeySetValue() {
|
||||
testAccount := suite.testAccounts["local_account_1"]
|
||||
|
||||
note := "this is my new note :)"
|
||||
|
||||
// try updating the note on zork
|
||||
err := suite.db.UpdateOneByPrimaryKey(context.Background(), "note", note, testAccount)
|
||||
suite.NoError(err)
|
||||
|
||||
// get zork out of the database
|
||||
dbAccount, err := suite.db.GetAccountByID(context.Background(), testAccount.ID)
|
||||
suite.NoError(err)
|
||||
suite.NotNil(dbAccount)
|
||||
|
||||
// note should be set now
|
||||
suite.Equal(note, dbAccount.Note)
|
||||
}
|
||||
|
||||
func TestBasicTestSuite(t *testing.T) {
|
||||
suite.Run(t, new(BasicTestSuite))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue