# Path: app/api/tests/utils.py
# def create_admin_account():
#     return User.objects.create_superuser(*admin_test_credentials)
# 
# def make_request(client, query, method='GET'):
#     header = {
#         'HTTP_X_TAVERNATOKEN': obtain_api_key(client)
#     }
# 
#     if method == 'GET':
#         return client.get(endpoint, data={'query': query}, **header).json()
# 
#     if method == 'POST':
#         return client.post(endpoint, data={'query': query}, **header).json()


from django.test import Client, TestCase
from .utils import create_admin_account, make_request
        response = make_request(self.client, query)

        self.assertEqual(expected, response)

    def test_retrieve_multiple_vendors_filter_by_name(self):
        self.create_multiple_vendors()
        query = 'query {vendors(name_Icontains: "ndor1") {edges{node{name}}}}'

        expected = {
            'vendors': [
                {
                    'name': self.first_vendor['name']
                }
            ]
        }

        response = make_request(self.client, query)

        self.assertEqual(expected, response)

    def test_update_vendor_object(self):
        # Update with valid id
        query = '''
            mutation{
                updateVendor(
                    input: {
                        id: "%s",
                        name: "vendor1_updated"
                    }
                )

# Path: app/api/tests/utils.py
# def create_admin_account():
#     return User.objects.create_superuser(*admin_test_credentials)
# 
# def make_request(client, query, method='GET'):
#     header = {
#         'HTTP_X_TAVERNATOKEN': obtain_api_key(client)
#     }
# 
#     if method == 'GET':
#         return client.get(endpoint, data={'query': query}, **header).json()
# 
#     if method == 'POST':
#         return client.post(endpoint, data={'query': query}, **header).json()


# Path: app/api/tests/test_vendor_api.py
from django.test import Client, TestCase
from .utils import create_admin_account, make_request

        response = make_request(self.client, query)

        self.assertEqual(expected, response)

    def test_retrieve_multiple_vendors_filter_by_name(self):
        self.create_multiple_vendors()
        query = 'query {vendors(name_Icontains: "ndor1") {edges{node{name}}}}'

        expected = {
            'vendors': [
                {
                    'name': self.first_vendor['name']
                }
            ]
        }

        response = make_request(self.client, query)

        self.assertEqual(expected, response)

    def test_update_vendor_object(self):
        # Update with valid id
        query = '''
            mutation{
                updateVendor(
                    input: {
                        id: "%s",
                        name: "vendor1_updated"
                    }
                )

                {