Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
8f70df6c
Commit
8f70df6c
authored
Mar 23, 2016
by
miraclesu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orm: add test case for insert specified value to auto field
parent
1786b16e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
orm_test.go
orm/orm_test.go
+21
-0
No files found.
orm/orm_test.go
View file @
8f70df6c
...
...
@@ -2013,3 +2013,24 @@ func TestIntegerPk(t *testing.T) {
throwFail
(
t
,
AssertIs
(
out
.
Value
,
intPk
.
Value
))
}
}
func
TestInsertAuto
(
t
*
testing
.
T
)
{
u
:=
&
User
{
UserName
:
"autoPre"
,
Email
:
"autoPre@gmail.com"
,
}
id
,
err
:=
dORM
.
Insert
(
u
)
throwFail
(
t
,
err
)
id
+=
100
su
:=
&
User
{
ID
:
int
(
id
),
UserName
:
"auto"
,
Email
:
"auto@gmail.com"
,
}
sid
,
err
:=
dORM
.
Insert
(
su
)
throwFail
(
t
,
err
)
throwFail
(
t
,
AssertIs
(
id
,
sid
))
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment