From 365514174ef00dcf426b2b5704c3d7adebe926e1 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 2 Feb 2017 11:46:42 -0500 Subject: Add tear down to APIv4 tests (#5250) * Add tear down to APIv4 tests * Defer tear downs --- api4/user_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'api4/user_test.go') diff --git a/api4/user_test.go b/api4/user_test.go index 713e0268b..501bb38e3 100644 --- a/api4/user_test.go +++ b/api4/user_test.go @@ -13,7 +13,8 @@ import ( ) func TestCreateUser(t *testing.T) { - th := Setup() + th := Setup().InitBasic() + defer TearDown() Client := th.Client user := model.User{Email: GenerateTestEmail(), Nickname: "Corey Hulen", Password: "hello1", Username: GenerateTestUsername(), Roles: model.ROLE_SYSTEM_ADMIN.Id + " " + model.ROLE_SYSTEM_USER.Id} @@ -28,6 +29,7 @@ func TestCreateUser(t *testing.T) { } if ruser.Roles != model.ROLE_SYSTEM_USER.Id { + t.Log(ruser.Roles) t.Fatal("did not clear roles") } @@ -67,6 +69,7 @@ func TestCreateUser(t *testing.T) { func TestGetUser(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() + defer TearDown() Client := th.Client user := th.CreateUser() @@ -130,6 +133,7 @@ func TestGetUser(t *testing.T) { func TestUpdateUser(t *testing.T) { th := Setup().InitBasic().InitSystemAdmin() + defer TearDown() Client := th.Client user := th.CreateUser() -- cgit v1.2.3-1-g7c22