@@ -0,0 +1,2607 @@
+from django.test import TestCase%0Afrom django.urls import reverse%0Afrom django.contrib.auth.models import User%0Afrom rest_framework.test import APIClient%0A%0Aclass GenericAPIStatusCode(TestCase):%0A    %22%22%22%0A    A generic class to test status code returned by API%0A    %22%22%22%0A    fixtures=%5B'test_api_user.yaml'%5D%0A%0A    def setUp(self):%0A        %22%22%22%0A        Common vars for tests%0A        %22%22%22%0A        self.admin = User.objects.get(pk=1)%0A        self.user = User.objects.get(pk=2)%0A        self.client = APIClient()%0A        self.endpoints = %7B%0A                'api-token-auth': self.endpoint_url('api-token-auth'),%0A                'users': self.endpoint_url('users-api'),%0A                'users-detail': self.endpoint_url(%0A                    'users-detail-api', args=(1,))%0A                %7D%0A        self.url_users_detail = reverse('users-detail-api', args=(1,))%0A%0A    def force_authenticate(self, user):%0A        %22%22%22%0A        Force authenticate of client with user%0A%0A        Parameters%0A        ----------%0A        user : Object%0A            A django.contrib.models.User instance%0A        %22%22%22%0A        self.client.force_authenticate(user=user)%0A%0A    def endpoint_url(self, urlname, args=None):%0A        %22%22%22%0A        Return url endpoint%0A%0A        Parameters%0A        ----------%0A        urlname : string%0A            The name of the pattern in urls.py%0A        args: list%0A            A list of arguments for the url%0A%0A        Returns%0A        -------%0A        The uri for the test client%0A        %22%22%22%0A        if args is not None:%0A            return reverse(urlname, args=args)%0A        else:%0A            return reverse(urlname)%0A%0A    def status_code_is(self, method, url, data, status_code):%0A        %22%22%22%0A        Assert that the response.status_code and status_code are equal.%0A%0A        Parameters%0A        ----------%0A        method : string%0A            The http method to use for the request%0A        url : string%0A            The target url for the request%0A        data : dict%0A            A dictionary of data to add in request (POST, PUT)%0A        status_code : int%0A            The integer representing the status code (2xx, 3xx, 4xx, 5xx)%0A%0A        Returns%0A        -------%0A        The test failed or not.%0A        %22%22%22%0A        if method == 'GET':%0A            response = self.client.get(url, format='json')%0A%0A        elif method == 'POST':%0A            response = self.client.post(url, data, format='json')%0A%0A        elif method == 'PUT':%0A            response = self.client.put(url, data, format='json')%0A%0A        elif method == 'DELETE':%0A            response = self.client.delete(url, format='json')%0A%0A        self.assertEqual(response.status_code, status_code)%0A

move class to billjobs.tests.generics file, add import