aboutsummaryrefslogtreecommitdiffstats
path: root/integrations/api_team_user_test.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-03-27 17:45:26 +0100
committerGitHub <noreply@github.com>2021-03-27 17:45:26 +0100
commit290cf75f9343a43d9770b1d6f8f3332a23357e27 (patch)
tree520f9f8616fbff3b43a1808ef2d73af3f2fe534b /integrations/api_team_user_test.go
parentf4d27498bdc615605e14f783501e1d1256cd8d22 (diff)
downloadgitea-290cf75f9343a43d9770b1d6f8f3332a23357e27.tar.gz
gitea-290cf75f9343a43d9770b1d6f8f3332a23357e27.zip
[refactor] Unify the export of user data via API (#15144)
* [refactor] unify how user data is exported via API * test time via unix timestamp
Diffstat (limited to 'integrations/api_team_user_test.go')
-rw-r--r--integrations/api_team_user_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/integrations/api_team_user_test.go b/integrations/api_team_user_test.go
index eec8634cb0..5a8fba512f 100644
--- a/integrations/api_team_user_test.go
+++ b/integrations/api_team_user_test.go
@@ -31,5 +31,13 @@ func TestAPITeamUser(t *testing.T) {
user2.Created = user2.Created.In(time.Local)
user := models.AssertExistsAndLoadBean(t, &models.User{Name: "user2"}).(*models.User)
- assert.Equal(t, convert.ToUser(user, true, false), user2)
+ expectedUser := convert.ToUser(user, user)
+
+ // test time via unix timestamp
+ assert.EqualValues(t, expectedUser.LastLogin.Unix(), user2.LastLogin.Unix())
+ assert.EqualValues(t, expectedUser.Created.Unix(), user2.Created.Unix())
+ expectedUser.LastLogin = user2.LastLogin
+ expectedUser.Created = user2.Created
+
+ assert.Equal(t, expectedUser, user2)
}