| 56 | } |
| 57 | |
| 58 | func createContext(s *testSetup) (*http.Request, context.Context) { |
| 59 | req, err := http.NewRequest( |
| 60 | http.MethodPost, |
| 61 | "http://"+s.HttpServer.Listener.Addr().String()+"/graphql", |
| 62 | nil, |
| 63 | ) |
| 64 | if err != nil { |
| 65 | panic("integration_tests.createContext: " + err.Error()) |
| 66 | } |
| 67 | |
| 68 | ctx := utils.ContextWithGin(req.Context(), s.GinContext) |
| 69 | s.GinContext.Request = req |
| 70 | return req, ctx |
| 71 | } |
| 72 | |
| 73 | // testAccessToken signs up a user via GraphQL and returns a bearer access token. |
| 74 | func testAccessToken(t *testing.T, ts *testSetup) string { |