forked from vikunja/vikunja
Added test for uid when creating a new team
This commit is contained in:
parent
6627c074bd
commit
b7918a694e
|
@ -24,7 +24,7 @@ import (
|
||||||
|
|
||||||
type team20190525101422 struct {
|
type team20190525101422 struct {
|
||||||
ID int64 `xorm:"int(11) autoincr not null unique pk"`
|
ID int64 `xorm:"int(11) autoincr not null unique pk"`
|
||||||
UID string `xorm:"varchar(32) not null default ''"`
|
UID string `xorm:"varchar(32) null"`
|
||||||
Name string `xorm:"varchar(250) not null"`
|
Name string `xorm:"varchar(250) not null"`
|
||||||
Description string `xorm:"varchar(250)"`
|
Description string `xorm:"varchar(250)"`
|
||||||
CreatedByID int64 `xorm:"int(11) not null INDEX"`
|
CreatedByID int64 `xorm:"int(11) not null INDEX"`
|
||||||
|
|
|
@ -23,7 +23,7 @@ type Team struct {
|
||||||
// The unique, numeric id of this team.
|
// The unique, numeric id of this team.
|
||||||
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"team"`
|
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"team"`
|
||||||
// The unique uuid for this team. Used to give a team access to things.
|
// The unique uuid for this team. Used to give a team access to things.
|
||||||
UID string `xorm:"varchar(32) not null" json:"uid"`
|
UID string `xorm:"varchar(32) null" json:"uid"`
|
||||||
// The name of this team.
|
// The name of this team.
|
||||||
Name string `xorm:"varchar(250) not null" json:"name" valid:"required,runelength(5|250)" minLength:"5" maxLength:"250"`
|
Name string `xorm:"varchar(250) not null" json:"name" valid:"required,runelength(5|250)" minLength:"5" maxLength:"250"`
|
||||||
// The team's description.
|
// The team's description.
|
||||||
|
|
|
@ -38,6 +38,8 @@ func TestTeam_Create(t *testing.T) {
|
||||||
assert.True(t, allowed)
|
assert.True(t, allowed)
|
||||||
err = dummyteam.Create(&doer)
|
err = dummyteam.Create(&doer)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
// Check the uid was created successfully
|
||||||
|
assert.NotEqual(t, "", dummyteam.UID)
|
||||||
|
|
||||||
// Check if it was inserted and we're admin
|
// Check if it was inserted and we're admin
|
||||||
tm := Team{ID: dummyteam.ID}
|
tm := Team{ID: dummyteam.ID}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user