mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
Override xorm type mapping for U2F counter (#6232)
This commit is contained in:
parent
141c58f5a6
commit
19862699cd
4 changed files with 43 additions and 1 deletions
|
@ -40,6 +40,14 @@ func TestU2FRegistration_UpdateCounter(t *testing.T) {
|
|||
AssertExistsIf(t, true, &U2FRegistration{ID: 1, Counter: 1})
|
||||
}
|
||||
|
||||
func TestU2FRegistration_UpdateLargeCounter(t *testing.T) {
|
||||
assert.NoError(t, PrepareTestDatabase())
|
||||
reg := AssertExistsAndLoadBean(t, &U2FRegistration{ID: 1}).(*U2FRegistration)
|
||||
reg.Counter = 0xffffffff
|
||||
assert.NoError(t, reg.UpdateCounter())
|
||||
AssertExistsIf(t, true, &U2FRegistration{ID: 1, Counter: 0xffffffff})
|
||||
}
|
||||
|
||||
func TestCreateRegistration(t *testing.T) {
|
||||
assert.NoError(t, PrepareTestDatabase())
|
||||
user := AssertExistsAndLoadBean(t, &User{ID: 1}).(*User)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue