diff options
author | 2024-04-11 11:45:53 +0200 | |
---|---|---|
committer | 2024-04-11 11:45:53 +0200 | |
commit | 9fb8a78f91adffd5f4d28df1270e407c25a7a16e (patch) | |
tree | d68200744e28d07e75a52bb0c9f6593c86a38a91 /testrig/testmodels.go | |
parent | [performance] massively improved ActivityPub delivery worker efficiency (#2812) (diff) | |
download | gotosocial-9fb8a78f91adffd5f4d28df1270e407c25a7a16e.tar.xz |
[feature] New user sign-up via web page (#2796)
* [feature] User sign-up form and admin notifs
* add chosen + filtered languages to migration
* remove stray comment
* chosen languages schmosen schmanguages
* proper error on local account missing
Diffstat (limited to 'testrig/testmodels.go')
-rw-r--r-- | testrig/testmodels.go | 64 |
1 files changed, 29 insertions, 35 deletions
diff --git a/testrig/testmodels.go b/testrig/testmodels.go index 50b15b04e..9ebd400e4 100644 --- a/testrig/testmodels.go +++ b/testrig/testmodels.go @@ -100,6 +100,12 @@ func NewTestTokens() map[string]*gtsmodel.Token { // NewTestClients returns a map of Clients keyed according to which account they are used by. func NewTestClients() map[string]*gtsmodel.Client { clients := map[string]*gtsmodel.Client{ + "instance_application": { + ID: "01AY6P665V14JJR0AFVRT7311Y", + Secret: "baedee87-6d00-4cf5-87b9-4d78ee58ef01", + Domain: "http://localhost:8080", + UserID: "", + }, "admin_account": { ID: "01F8MGWSJCND9BWBD4WGJXBM93", Secret: "dda8e835-2c9c-4bd2-9b8b-77c2e26d7a7a", @@ -125,6 +131,15 @@ func NewTestClients() map[string]*gtsmodel.Client { // NewTestApplications returns a map of applications keyed to which number application they are. func NewTestApplications() map[string]*gtsmodel.Application { apps := map[string]*gtsmodel.Application{ + "instance_application": { + ID: "01HT5P2YHDMPAAD500NDAY8JW1", + Name: "localhost:8080 instance application", + Website: "http://localhost:8080", + RedirectURI: "http://localhost:8080", + ClientID: "01AY6P665V14JJR0AFVRT7311Y", // instance account ID + ClientSecret: "baedee87-6d00-4cf5-87b9-4d78ee58ef01", + Scopes: "write:accounts", + }, "admin_account": { ID: "01F8MGXQRHYF5QPMTMXP78QC2F", Name: "superseriousbusiness", @@ -167,14 +182,8 @@ func NewTestUsers() map[string]*gtsmodel.User { CreatedAt: TimeMustParse("2022-06-04T13:12:00Z"), SignUpIP: net.ParseIP("199.222.111.89"), UpdatedAt: time.Time{}, - CurrentSignInAt: time.Time{}, - CurrentSignInIP: nil, - LastSignInAt: time.Time{}, - LastSignInIP: nil, - SignInCount: 0, InviteID: "", - ChosenLanguages: []string{}, - FilteredLanguages: []string{}, + Reason: "hi, please let me in! I'm looking for somewhere neato bombeato to hang out.", Locale: "en", CreatedByApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG", LastEmailedAt: time.Time{}, @@ -195,16 +204,9 @@ func NewTestUsers() map[string]*gtsmodel.User { AccountID: "01F8MH17FWEB39HZJ76B6VXSKF", EncryptedPassword: "$2y$10$ggWz5QWwnx6kzb9g0tnIJurFtE0dhr5Zfeaqs9iFuUIXzafQlJVZS", // 'password' CreatedAt: TimeMustParse("2022-06-01T13:12:00Z"), - SignUpIP: net.ParseIP("89.22.189.19"), + SignUpIP: nil, UpdatedAt: TimeMustParse("2022-06-01T13:12:00Z"), - CurrentSignInAt: TimeMustParse("2022-06-04T13:12:00Z"), - CurrentSignInIP: net.ParseIP("89.122.255.1"), - LastSignInAt: TimeMustParse("2022-06-03T13:12:00Z"), - LastSignInIP: net.ParseIP("89.122.255.1"), - SignInCount: 78, InviteID: "", - ChosenLanguages: []string{"en"}, - FilteredLanguages: []string{}, Locale: "en", CreatedByApplicationID: "01F8MGXQRHYF5QPMTMXP78QC2F", LastEmailedAt: TimeMustParse("2022-06-03T13:12:00Z"), @@ -225,16 +227,10 @@ func NewTestUsers() map[string]*gtsmodel.User { AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", EncryptedPassword: "$2y$10$ggWz5QWwnx6kzb9g0tnIJurFtE0dhr5Zfeaqs9iFuUIXzafQlJVZS", // 'password' CreatedAt: TimeMustParse("2022-06-01T13:12:00Z"), - SignUpIP: net.ParseIP("59.99.19.172"), + SignUpIP: nil, UpdatedAt: TimeMustParse("2022-06-01T13:12:00Z"), - CurrentSignInAt: TimeMustParse("2022-06-04T13:12:00Z"), - CurrentSignInIP: net.ParseIP("88.234.118.16"), - LastSignInAt: TimeMustParse("2022-06-03T13:12:00Z"), - LastSignInIP: net.ParseIP("147.111.231.154"), - SignInCount: 9, InviteID: "", - ChosenLanguages: []string{"en"}, - FilteredLanguages: []string{}, + Reason: "I wanna be on this damned webbed site so bad! Please! Wow", Locale: "en", CreatedByApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG", LastEmailedAt: TimeMustParse("2022-06-02T13:12:00Z"), @@ -255,16 +251,9 @@ func NewTestUsers() map[string]*gtsmodel.User { AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", EncryptedPassword: "$2y$10$ggWz5QWwnx6kzb9g0tnIJurFtE0dhr5Zfeaqs9iFuUIXzafQlJVZS", // 'password' CreatedAt: TimeMustParse("2022-05-23T13:12:00Z"), - SignUpIP: net.ParseIP("59.99.19.172"), + SignUpIP: nil, UpdatedAt: TimeMustParse("2022-05-23T13:12:00Z"), - CurrentSignInAt: TimeMustParse("2022-06-05T13:12:00Z"), - CurrentSignInIP: net.ParseIP("118.44.18.196"), - LastSignInAt: TimeMustParse("2022-06-06T13:12:00Z"), - LastSignInIP: net.ParseIP("198.98.21.15"), - SignInCount: 9, InviteID: "", - ChosenLanguages: []string{"en"}, - FilteredLanguages: []string{}, Locale: "en", CreatedByApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG", LastEmailedAt: TimeMustParse("2022-06-06T13:12:00Z"), @@ -664,7 +653,6 @@ func NewTestAccountSettings() map[string]*gtsmodel.AccountSettings { AccountID: "01F8MH0BBE4FHXPH513MBVFHB0", CreatedAt: TimeMustParse("2022-06-04T13:12:00Z"), UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"), - Reason: "hi, please let me in! I'm looking for somewhere neato bombeato to hang out.", Privacy: gtsmodel.VisibilityPublic, Sensitive: util.Ptr(false), Language: "en", @@ -675,7 +663,6 @@ func NewTestAccountSettings() map[string]*gtsmodel.AccountSettings { AccountID: "01F8MH17FWEB39HZJ76B6VXSKF", CreatedAt: TimeMustParse("2022-05-17T13:10:59Z"), UpdatedAt: TimeMustParse("2022-05-17T13:10:59Z"), - Reason: "", Privacy: gtsmodel.VisibilityPublic, Sensitive: util.Ptr(false), Language: "en", @@ -686,7 +673,6 @@ func NewTestAccountSettings() map[string]*gtsmodel.AccountSettings { AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", CreatedAt: TimeMustParse("2022-05-20T11:09:18Z"), UpdatedAt: TimeMustParse("2022-05-20T11:09:18Z"), - Reason: "I wanna be on this damned webbed site so bad! Please! Wow", Privacy: gtsmodel.VisibilityPublic, Sensitive: util.Ptr(false), Language: "en", @@ -697,7 +683,6 @@ func NewTestAccountSettings() map[string]*gtsmodel.AccountSettings { AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", CreatedAt: TimeMustParse("2022-06-04T13:12:00Z"), UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"), - Reason: "", Privacy: gtsmodel.VisibilityFollowersOnly, Sensitive: util.Ptr(true), Language: "fr", @@ -2428,6 +2413,15 @@ func NewTestNotifications() map[string]*gtsmodel.Notification { StatusID: "01F8MH75CBF9JFX4ZAD54N0W0R", Read: util.Ptr(false), }, + "new_signup": { + ID: "01HTM9TETMB3YQCBKZ7KD4KV02", + NotificationType: gtsmodel.NotificationSignup, + CreatedAt: TimeMustParse("2022-06-04T13:12:00Z"), + TargetAccountID: "01F8MH17FWEB39HZJ76B6VXSKF", + OriginAccountID: "01F8MH0BBE4FHXPH513MBVFHB0", + StatusID: "", + Read: util.Ptr(false), + }, } } |