Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion models/auth/oauth2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ import (
"github.com/stretchr/testify/assert"
)

//////////////////// Application
func TestApplicationTableName(t *testing.T) {
e := unittest.GetXORMEngine()
tableInfo, err := e.TableInfo(new(auth_model.OAuth2Application))
assert.NoError(t, err)
assert.EqualValues(t, "oauth2_application", tableInfo.Name)
}
Comment thread
lunny marked this conversation as resolved.
Outdated

func TestOAuth2Application_GenerateClientSecret(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
Expand Down
2 changes: 1 addition & 1 deletion models/migrations/v1_18/v230.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ func AddConfidentialClientColumnToOAuth2ApplicationTable(x *xorm.Engine) error {
ConfidentialClient bool `xorm:"NOT NULL DEFAULT TRUE"`
}

return x.Sync(new(OAuth2Application))
return x.Table("oauth2_application").Sync(new(OAuth2Application))
Comment thread
lunny marked this conversation as resolved.
Outdated
}
2 changes: 1 addition & 1 deletion models/migrations/v1_18/v230_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Test_AddConfidentialClientColumnToOAuth2ApplicationTable(t *testing.T) {
}

got := []ExpectedOAuth2Application{}
if err := x.Table("o_auth2_application").Select("id, confidential_client").Find(&got); !assert.NoError(t, err) {
if err := x.Table("oauth2_application").Select("id, confidential_client").Find(&got); !assert.NoError(t, err) {
Comment thread
lunny marked this conversation as resolved.
return
}

Expand Down