summaryrefslogtreecommitdiff
path: root/testrig
diff options
context:
space:
mode:
Diffstat (limited to 'testrig')
-rw-r--r--testrig/config.go1
-rw-r--r--testrig/email.go5
-rw-r--r--testrig/testmodels.go64
3 files changed, 34 insertions, 36 deletions
diff --git a/testrig/config.go b/testrig/config.go
index d33c4ac8c..8b69b714c 100644
--- a/testrig/config.go
+++ b/testrig/config.go
@@ -89,7 +89,6 @@ var testDefaults = config.Configuration{
},
AccountsRegistrationOpen: true,
- AccountsApprovalRequired: true,
AccountsReasonRequired: true,
AccountsAllowCustomCSS: true,
AccountsCustomCSSLength: 10000,
diff --git a/testrig/email.go b/testrig/email.go
index 1107dfd26..a80054f30 100644
--- a/testrig/email.go
+++ b/testrig/email.go
@@ -20,6 +20,7 @@ package testrig
import (
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/email"
+ "github.com/superseriousbusiness/gotosocial/internal/log"
)
// NewEmailSender returns a noop email sender that won't make any remote calls.
@@ -38,6 +39,10 @@ func NewEmailSender(templateBaseDir string, sentEmails map[string]string) email.
sendCallback = func(toAddress string, message string) {
sentEmails[toAddress] = message
}
+ } else {
+ sendCallback = func(toAddress string, message string) {
+ log.Infof(nil, "Sent email to %s: %s", toAddress, message)
+ }
}
s, err := email.NewNoopSender(sendCallback)
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),
+ },
}
}