nolint:revive // It's a control flag, but this is a test.
( t *testing.T, db database.Store, userID uuid.UUID, templateDeleted bool, templateName string, org database.Organization, )
| 3051 | |
| 3052 | // nolint:revive // It's a control flag, but this is a test. |
| 3053 | func setupTestDBTemplateWithinOrg( |
| 3054 | t *testing.T, |
| 3055 | db database.Store, |
| 3056 | userID uuid.UUID, |
| 3057 | templateDeleted bool, |
| 3058 | templateName string, |
| 3059 | org database.Organization, |
| 3060 | ) database.Template { |
| 3061 | t.Helper() |
| 3062 | |
| 3063 | template := dbgen.Template(t, db, database.Template{ |
| 3064 | Name: templateName, |
| 3065 | CreatedBy: userID, |
| 3066 | OrganizationID: org.ID, |
| 3067 | CreatedAt: time.Now().Add(muchEarlier), |
| 3068 | }) |
| 3069 | if templateDeleted { |
| 3070 | ctx := testutil.Context(t, testutil.WaitShort) |
| 3071 | require.NoError(t, db.UpdateTemplateDeletedByID(ctx, database.UpdateTemplateDeletedByIDParams{ |
| 3072 | ID: template.ID, |
| 3073 | Deleted: true, |
| 3074 | })) |
| 3075 | } |
| 3076 | return template |
| 3077 | } |
| 3078 | |
| 3079 | const ( |
| 3080 | earlier = -time.Hour |
no test coverage detected