dataprovider: add timestamp fields for users and admins

This commit is contained in:
Nicola Murino
2021-08-19 15:51:43 +02:00
parent b99d4ce82e
commit be3857d572
52 changed files with 725 additions and 76 deletions

View File

@@ -1058,6 +1058,11 @@ func checkAdmin(expected, actual *dataprovider.Admin) error {
return errors.New("admin ID mismatch")
}
}
if expected.CreatedAt > 0 {
if expected.CreatedAt != actual.CreatedAt {
return fmt.Errorf("created_at mismatch %v != %v", expected.CreatedAt, actual.CreatedAt)
}
}
if err := compareAdminEqualFields(expected, actual); err != nil {
return err
}
@@ -1116,6 +1121,11 @@ func checkUser(expected *dataprovider.User, actual *dataprovider.User) error {
return errors.New("user ID mismatch")
}
}
if expected.CreatedAt > 0 {
if expected.CreatedAt != actual.CreatedAt {
return fmt.Errorf("created_at mismatch %v != %v", expected.CreatedAt, actual.CreatedAt)
}
}
if len(expected.Permissions) != len(actual.Permissions) {
return errors.New("permissions mismatch")
}