mirror of
https://github.com/photoprism/photoprism.git
synced 2025-10-05 16:57:17 +08:00
24 lines
369 B
Go
24 lines
369 B
Go
package entity
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestPasscode_MarshalJSON(t *testing.T) {
|
|
m := &Passcode{
|
|
UID: "uqxc08w3d0ej2283",
|
|
KeyURL: "otpauth://totp/Example:alice",
|
|
RecoveryCode: "123",
|
|
}
|
|
|
|
r, err := m.MarshalJSON()
|
|
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
assert.Contains(t, string(r), "uqxc08w3d0ej2283")
|
|
}
|