Add section on automated testing to cookbook tutorial
The official Django tutorial covers writing automated tests. I know there is a section on testing in the Graphene docs, but I think it would help if this was adapted to the cookbook tutorial. I'm wondering if this is something open for discussion or if the plan is to keep the introductory tutorial as short as possible.
@joychen I think they will be like standard django tests only. Just pass the query or mutation string as data.
from django.urls import reverse
from django.test import Client as BaseClient
class Client(BaseClient):
url = reverse("graphql")
def query(self, query):
response = self.get(path=self.url, data={"query": query})
return response
Agreed, there's some room for improvement here @joyhchen. We've made some strides on the docs end and we're going to continue to harmonize it with the cookbook example. I'm going to close this because it is in good-enough-for-now territory but do know we'll continue to improve the docs.