# Path: app/timetables/factories.py
# class ServingFactory(TimestampFactory):
#     """Serving model factory."""
# 
#     class Meta:
#         model = models.Serving
# 
#     menu_item = factory.SubFactory(MenuItemFactory)
#     vendor = factory.SubFactory(VendorFactory)
#     date_served = datetime.date(2016, 10, 1)
# 
# 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 app.timetables.factories import ServingFactory
from .utils import create_admin_account, make_request
            'reviews': [
                {
                    'value': self.first_review['value'],
                    'comment': self.first_review['comment'],
                },
                {
                    'value': self.reviews[0][1],
                    'comment': self.reviews[0][2],
                },
                {
                    'value': self.reviews[1][1],
                    'comment': self.reviews[1][2],
                },
            ]
        }

        response = make_request(self.client, query)

        self.assertEqual(expected, response)

    def test_update_review_object(self):
        # Update with valid id
        query = '''
            mutation{
                updateReview(
                    input: {
                        id: "%s",
                        value: "1"
                    }
                )

# Path: app/timetables/factories.py
# class ServingFactory(TimestampFactory):
#     """Serving model factory."""
# 
#     class Meta:
#         model = models.Serving
# 
#     menu_item = factory.SubFactory(MenuItemFactory)
#     vendor = factory.SubFactory(VendorFactory)
#     date_served = datetime.date(2016, 10, 1)
# 
# 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_review_api.py
from django.test import Client, TestCase
from app.timetables.factories import ServingFactory
from .utils import create_admin_account, make_request

            'reviews': [
                {
                    'value': self.first_review['value'],
                    'comment': self.first_review['comment'],
                },
                {
                    'value': self.reviews[0][1],
                    'comment': self.reviews[0][2],
                },
                {
                    'value': self.reviews[1][1],
                    'comment': self.reviews[1][2],
                },
            ]
        }

        response = make_request(self.client, query)

        self.assertEqual(expected, response)

    def test_update_review_object(self):
        # Update with valid id
        query = '''
            mutation{
                updateReview(
                    input: {
                        id: "%s",
                        value: "1"
                    }
                )

                {