# Path: bucketlistapp/bucketlistapi/tests/test_bucketlist.py
# class ApiHeaderAuthorization(APITestCase):
# 
#     '''Base class used to Attach header to all request on setup.'''
# 
#     fixtures = ['initial_fix']
# 
#     def setUp(self):
# 
#         #Include an appropriate `Authorization:` header on all requests.
#         token = Token.objects.get(user__username='samuel')
#         self.client = APIClient()
#         self.client.credentials(HTTP_AUTHORIZATION='Token ' + token.key)


from rest_framework.authtoken.models import Token
from rest_framework.test import APIClient
from django.core.urlresolvers import reverse_lazy
from rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth.models import User
from .test_bucketlist import ApiHeaderAuthorization
''' Script used to test bucketlistitem response and request.'''



class ApiUserBucketlistItems(ApiHeaderAuthorization):

    def test_user_can_addbucketlist(self):

        data={'name': 'item', 'done': True }
        url= reverse_lazy('addbucketitem', kwargs={'id':19})
        response = self.client.post(url, data)
        self.assertEqual(response.status_code, status.HTTP_201_CREATED)



# Path: bucketlistapp/bucketlistapi/tests/test_bucketlist.py
# class ApiHeaderAuthorization(APITestCase):
# 
#     '''Base class used to Attach header to all request on setup.'''
# 
#     fixtures = ['initial_fix']
# 
#     def setUp(self):
# 
#         #Include an appropriate `Authorization:` header on all requests.
#         token = Token.objects.get(user__username='samuel')
#         self.client = APIClient()
#         self.client.credentials(HTTP_AUTHORIZATION='Token ' + token.key)


# Path: bucketlistapp/bucketlistapi/tests/test_bucketlistitems.py
from rest_framework.authtoken.models import Token
from rest_framework.test import APIClient
from django.core.urlresolvers import reverse_lazy
from rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth.models import User
from .test_bucketlist import ApiHeaderAuthorization

''' Script used to test bucketlistitem response and request.'''



class ApiUserBucketlistItems(ApiHeaderAuthorization):

    def test_user_can_addbucketlist(self):

        data={'name': 'item', 'done': True }
        url= reverse_lazy('addbucketitem', kwargs={'id':19})
        response = self.client.post(url, data)
        self.assertEqual(response.status_code, status.HTTP_201_CREATED)



class ApiUserItemListDetail(ApiHeaderAuthorization):