Created
August 23, 2019 14:36
-
-
Save Glyphack/7617d6df0c9cbe71e28440feb02ba36a to your computer and use it in GitHub Desktop.
graphql test case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth import get_user_model | |
from utils.test_utils import APITestCase | |
from .graphql_requests import ( | |
CREATE_LINK_MUTATION | |
) | |
class LinkTestCase(APITestCase): | |
def setUp(self): | |
super().setUp() | |
self.dummy_user = get_user_model().objects.create( | |
username="dummy_user", | |
password="dummy_password" | |
) | |
def test_create_link_user_logged_in(self): | |
self.snapshot_graphql_request( | |
request_string=CREATE_LINK_MUTATION, | |
variables={"url": "example.com", "desc": "example link"}, | |
context={"user": self.dummy_user} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment