Fixes: 1) Correct redundant user lookup in JWT mutations. Extra: 1) Add TODO comments for HTTP method tests in both DRF and Graphene test modules; 2) Minor cleanup in test files.
18 lines
628 B
Python
18 lines
628 B
Python
from typing import Any
|
|
|
|
from django.test import TestCase
|
|
from django.urls import reverse
|
|
|
|
|
|
class GraphQLCoreTests(TestCase):
|
|
def graphql(self, query: str, variables: dict | None = None):
|
|
url = reverse("graphql-platform")
|
|
payload: dict[str, Any] = {"query": query}
|
|
if variables:
|
|
payload["variables"] = variables
|
|
response = self.client.post(url, data=payload, content_type="application/json")
|
|
self.assertEqual(response.status_code, 200, response.json())
|
|
return response.json()
|
|
|
|
|
|
# TODO: create tests for every possible HTTP method in core module with Graphene stack
|